mirror of https://github.com/status-im/consul.git
consul: Only close the cursor for read-only transactions (mdb)
This commit is contained in:
parent
80439376cf
commit
2d937bc0a8
|
@ -535,7 +535,11 @@ func (i *MDBIndex) iterate(tx *MDBTxn, prefix []byte,
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
// Read-only cursors are NOT closed by MDB when a transaction
|
||||||
|
// either commits or aborts, so must be closed explicitly
|
||||||
|
if tx.readonly {
|
||||||
defer cursor.Close()
|
defer cursor.Close()
|
||||||
|
}
|
||||||
|
|
||||||
var key, encRowId, objBytes []byte
|
var key, encRowId, objBytes []byte
|
||||||
first := true
|
first := true
|
||||||
|
|
Loading…
Reference in New Issue