|
|
@ -135,13 +135,9 @@ func (v *Volume) deleteNeedle(n *needle.Needle) (uint32, error) { |
|
|
|
// read fills in Needle content by looking up n.Id from NeedleMapper
|
|
|
|
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 |
|
|
|
} |
|
|
|
} |
|
|
|
if nv.Size == TombstoneFileSize { |
|
|
|
return -1, errors.New("already deleted") |
|
|
|
} |
|
|
|