From f11567816e4412c39839e5d4d8caa793a2a14bf4 Mon Sep 17 00:00:00 2001 From: chrislu Date: Thu, 17 Oct 2024 18:52:30 -0700 Subject: [PATCH] Revert "fix: volume data integrity check (#6118)" This reverts commit e12b9ab7460aa635e32190e9f61f37fdc7b794f6. --- weed/storage/volume_checking.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/weed/storage/volume_checking.go b/weed/storage/volume_checking.go index 202fc58e0..9bd432f85 100644 --- a/weed/storage/volume_checking.go +++ b/weed/storage/volume_checking.go @@ -2,11 +2,10 @@ package storage import ( "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" @@ -27,11 +26,11 @@ func CheckVolumeDataIntegrity(v *Volume, indexFile *os.File) (lastAppendAtNs uin for i := 1; i <= 10 && indexSize >= int64(i)*NeedleMapEntrySize; i++ { // check and fix last 10 entries lastAppendAtNs, err = doCheckAndFixVolumeData(v, indexFile, indexSize-int64(i)*NeedleMapEntrySize) - if err != nil { - if err == io.EOF { - healthyIndexSize = indexSize - int64(i)*NeedleMapEntrySize - continue - } + if err == io.EOF { + healthyIndexSize = indexSize - int64(i)*NeedleMapEntrySize + continue + } + if err != ErrorSizeMismatch { break } }