Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(iterators): Do not return error on missing vlog #1602

Merged
merged 3 commits into from
Nov 25, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion iterator.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,27 @@ func (item *Item) yieldItemValue() ([]byte, func(), error) {
if err != nil {
db.opt.Logger.Errorf("Unable to read: Key: %v, Version : %v, meta: %v, userMeta: %v"+
" Error: %v", key, item.version, item.meta, item.userMeta, err)
txn := db.NewTransaction(false)
defer txn.Discard()

iopt := DefaultIteratorOptions
iopt.AllVersions = true
iopt.InternalAccess = true

it := txn.NewKeyIterator(item.Key(), iopt)
defer it.Close()
for it.Rewind(); it.Valid(); it.Next() {
item := it.Item()
var vp valuePointer
if item.meta&bitValuePointer > 0 {
vp.Decode(item.vptr)
}
db.opt.Logger.Errorf("Key: %v, Version : %v, meta: %v, userMeta: %v valuePointer: %+v",
item.Key(), item.version, item.meta, item.userMeta, vp)
}
}
return result, cb, err
// Don't return error if we cannot read the value. Just log the error.
return result, cb, nil
}

func runCallback(cb func()) {
Expand Down