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.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
fix: volume data integrity check (#6118)
wusonge12b9ab7460a
diff --git a/weed/storage/volume_checking.go b/weed/storage/volume_checking.goindex 9bd432f857..202fc58e0d 100644--- a/weed/storage/volume_checking.go+++ b/weed/storage/volume_checking.go@@ -2,10 +2,11 @@ package storageimport ("fmt"- "github.com/seaweedfs/seaweedfs/weed/storage/super_block""io""os"+ "github.com/seaweedfs/seaweedfs/weed/storage/super_block"+"github.com/seaweedfs/seaweedfs/weed/glog""github.com/seaweedfs/seaweedfs/weed/storage/backend""github.com/seaweedfs/seaweedfs/weed/storage/idx"@@ -26,11 +27,11 @@ func CheckVolumeDataIntegrity(v *Volume, indexFile *os.File) (lastAppendAtNs uinfor i := 1; i <= 10 && indexSize >= int64(i)*NeedleMapEntrySize; i++ {// check and fix last 10 entrieslastAppendAtNs, err = doCheckAndFixVolumeData(v, indexFile, indexSize-int64(i)*NeedleMapEntrySize)- if err == io.EOF {- healthyIndexSize = indexSize - int64(i)*NeedleMapEntrySize- continue- }- if err != ErrorSizeMismatch {+ if err != nil {+ if err == io.EOF {+ healthyIndexSize = indexSize - int64(i)*NeedleMapEntrySize+ continue+ }break}}