volume: automatically trim out unreachable entries

This commit is contained in:
Chris Lu
2020-10-28 01:14:39 -07:00
parent 3e925faddd
commit 744c5594da
2 changed files with 53 additions and 22 deletions

View File

@@ -89,7 +89,7 @@ func (v *Volume) load(alsoLoadIndex bool, createDatIfMissing bool, needleMapKind
return fmt.Errorf("cannot write Volume Index %s.idx: %v", fileName, err)
}
}
if v.lastAppendAtNs, err = CheckVolumeDataIntegrity(v, indexFile); err != nil {
if v.lastAppendAtNs, err = CheckAndFixVolumeDataIntegrity(v, indexFile); err != nil {
v.noWriteOrDelete = true
glog.V(0).Infof("volumeDataIntegrityChecking failed %v", err)
}