Skip to content

Commit

Permalink
Do not return ErrRetry if even the move key points to a deleted value…
Browse files Browse the repository at this point in the history
… log. Instead, assume that the value is not present and return nil.
  • Loading branch information
manishrjain committed Sep 18, 2018
1 parent 8a9c317 commit d055ef4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions iterator.go
Expand Up @@ -160,10 +160,15 @@ func (item *Item) yieldItemValue() ([]byte, func(), error) {
var vp valuePointer
vp.Decode(item.vptr)
result, cb, err := item.db.vlog.Read(vp, item.slice)
if err != ErrRetry || bytes.HasPrefix(key, badgerMove) {
// The error is not retry, or we have already searched the move keyspace.
if err != ErrRetry {
return result, cb, err
}
if bytes.HasPrefix(key, badgerMove) {
// err == ErrRetry
// Error is retry even after checking the move keyspace. So, let's
// just assume that value is not present.
return nil, cb, nil
}

// The value pointer is pointing to a deleted value log. Look for the
// move key and read that instead.
Expand Down

0 comments on commit d055ef4

Please sign in to comment.