aboutsummaryrefslogtreecommitdiff
path: root/weed/storage/volume_checking.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/storage/volume_checking.go')
-rw-r--r--weed/storage/volume_checking.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/weed/storage/volume_checking.go b/weed/storage/volume_checking.go
index 048944199..00e04047f 100644
--- a/weed/storage/volume_checking.go
+++ b/weed/storage/volume_checking.go
@@ -22,7 +22,7 @@ func CheckAndFixVolumeDataIntegrity(v *Volume, indexFile *os.File) (lastAppendAt
return 0, nil
}
healthyIndexSize := indexSize
- for i := 1; i <= 10; i++ {
+ 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 == io.EOF {