volume: avoid compacting wait group

This commit is contained in:
Chris Lu
2019-07-21 13:49:59 -07:00
parent 4b15c8f0c4
commit 33b3366043
3 changed files with 1 additions and 8 deletions

View File

@@ -136,11 +136,7 @@ func (v *Volume) deleteNeedle(n *needle.Needle) (uint32, error) {
func (v *Volume) readNeedle(n *needle.Needle) (int, error) {
nv, ok := v.nm.Get(n.Id)
if !ok || nv.Offset.IsZero() {
v.compactingWg.Wait()
nv, ok = v.nm.Get(n.Id)
if !ok || nv.Offset.IsZero() {
return -1, ErrorNotFound
}
return -1, ErrorNotFound
}
if nv.Size == TombstoneFileSize {
return -1, errors.New("already deleted")