Skip to content

Commit

Permalink
Bug Fix: Create the right txn based on Badger mode
Browse files Browse the repository at this point in the history
  • Loading branch information
manishrjain committed Nov 26, 2020
1 parent ab8b5d9 commit 3d225d7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion iterator.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"bytes"
"fmt"
"hash/crc32"
"math"
"sort"
"sync"
"sync/atomic"
Expand Down Expand Up @@ -170,7 +171,12 @@ 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)
var txn *Txn
if db.opt.managedTxns {
txn = db.NewTransactionAt(math.MaxUint64, false)
} else {
txn = db.NewTransaction(false)
}
defer txn.Discard()

iopt := DefaultIteratorOptions
Expand Down

0 comments on commit 3d225d7

Please sign in to comment.