fix volume integrity checking

This commit is contained in:
Chris Lu 2020-09-11 11:34:10 -07:00
parent 1b8094ef75
commit 9d4bdfcfdf

View file

@ -27,8 +27,8 @@ func CheckVolumeDataIntegrity(v *Volume, indexFile *os.File) (lastAppendAtNs uin
if offset.IsZero() {
return 0, nil
}
if size.IsDeleted() {
size = 0
if size < 0 {
size = -size
}
if lastAppendAtNs, e = verifyNeedleIntegrity(v.DataBackend, v.Version(), offset.ToAcutalOffset(), key, size); e != nil {
return lastAppendAtNs, fmt.Errorf("verifyNeedleIntegrity %s failed: %v", indexFile.Name(), e)