mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
Merge pull request #347 from hxiaodon/master
deleted needle does not need checksum verification(patch)
This commit is contained in:
commit
761ef1c73e
|
@ -21,6 +21,10 @@ func CheckVolumeDataIntegrity(v *Volume, indexFile *os.File) error {
|
||||||
return fmt.Errorf("readLastIndexEntry %s failed: %v", indexFile.Name(), e)
|
return fmt.Errorf("readLastIndexEntry %s failed: %v", indexFile.Name(), e)
|
||||||
}
|
}
|
||||||
key, offset, size := idxFileEntry(lastIdxEntry)
|
key, offset, size := idxFileEntry(lastIdxEntry)
|
||||||
|
//deleted index entry could not point to deleted needle
|
||||||
|
if offset == 0 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
if e = verifyNeedleIntegrity(v.dataFile, v.Version(), int64(offset)*NeedlePaddingSize, key, size); e != nil {
|
if e = verifyNeedleIntegrity(v.dataFile, v.Version(), int64(offset)*NeedlePaddingSize, key, size); e != nil {
|
||||||
return fmt.Errorf("verifyNeedleIntegrity %s failed: %v", indexFile.Name(), e)
|
return fmt.Errorf("verifyNeedleIntegrity %s failed: %v", indexFile.Name(), e)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue