Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

skip truncation on error

chrislub6d7556dda6e
diff --git a/weed/shell/command_volume_fsck.go b/weed/shell/command_volume_fsck.go
index cae8e22d43..04d8bc2c45 100644
--- a/weed/shell/command_volume_fsck.go
+++ b/weed/shell/command_volume_fsck.go
@@ -407,9 +407,10 @@ func (c *commandVolumeFsck) collectOneVolumeFileIds(tempFolder string, dataNodeI
return resp.LastModified <= cutoffFrom, nil
})
if err != nil {
- fmt.Fprintf(writer, "Failed to search for last vilad index on volume %d with error %v", volumeId, err)
+ fmt.Fprintf(writer, "Failed to search for last valid index on volume %d with error %v", volumeId, err)
+ } else {
+ buf.Truncate(index * types.NeedleMapEntrySize)
}
- buf.Truncate(index * types.NeedleMapEntrySize)
}
idxFilename := getVolumeFileIdFile(tempFolder, dataNodeId, volumeId)
err = writeToFile(buf.Bytes(), idxFilename)