aboutsummaryrefslogtreecommitdiff
path: root/weed/storage/volume_checking.go
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2024-09-29 20:47:16 -0700
committerchrislu <chris.lu@gmail.com>2024-09-29 20:47:16 -0700
commit190b2fc27637017cdd075331fd04b8cb0e5879b7 (patch)
tree93db54c4ad83af2b09eb7862380b8c634154e203 /weed/storage/volume_checking.go
parent8111ec13bd06e4a9142a87640986de8c41d4b75a (diff)
parent20929f2a5753a04385be2378e698c8df762b3256 (diff)
downloadseaweedfs-origin/mq2.tar.xz
seaweedfs-origin/mq2.zip
Merge branch 'master' into mq2origin/mq2
Diffstat (limited to 'weed/storage/volume_checking.go')
-rw-r--r--weed/storage/volume_checking.go8
1 files changed, 2 insertions, 6 deletions
diff --git a/weed/storage/volume_checking.go b/weed/storage/volume_checking.go
index f5ceffcce..9bd432f85 100644
--- a/weed/storage/volume_checking.go
+++ b/weed/storage/volume_checking.go
@@ -14,7 +14,7 @@ import (
"github.com/seaweedfs/seaweedfs/weed/util"
)
-func CheckAndFixVolumeDataIntegrity(v *Volume, indexFile *os.File) (lastAppendAtNs uint64, err error) {
+func CheckVolumeDataIntegrity(v *Volume, indexFile *os.File) (lastAppendAtNs uint64, err error) {
var indexSize int64
if indexSize, err = verifyIndexFileIntegrity(indexFile); err != nil {
return 0, fmt.Errorf("verifyIndexFileIntegrity %s failed: %v", indexFile.Name(), err)
@@ -35,11 +35,7 @@ func CheckAndFixVolumeDataIntegrity(v *Volume, indexFile *os.File) (lastAppendAt
}
}
if healthyIndexSize < indexSize {
- glog.Warningf("CheckAndFixVolumeDataIntegrity truncate idx file %s from %d to %d", indexFile.Name(), indexSize, healthyIndexSize)
- err = indexFile.Truncate(healthyIndexSize)
- if err != nil {
- glog.Warningf("CheckAndFixVolumeDataIntegrity truncate idx file %s from %d to %d: %v", indexFile.Name(), indexSize, healthyIndexSize, err)
- }
+ return 0, fmt.Errorf("CheckVolumeDataIntegrity %s failed: index size %d differs from healthy size %d", indexFile.Name(), indexSize, healthyIndexSize)
}
return
}