Skip to content

Commit

Permalink
fix GetOrCreateTxnWithMeta not get txn error (#18705)
Browse files Browse the repository at this point in the history
fix not get txn.

Approved by: @XuPeng-SH, @sukki37
  • Loading branch information
w-zr authored Sep 11, 2024
1 parent 37ab251 commit 2fed24b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/vm/engine/tae/txn/txnbase/txnmgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,9 @@ func (mgr *TxnManager) GetOrCreateTxnWithMeta(
logutil.Warnf("StartTxn: %v", err)
return
}
if _, ok := mgr.IDMap.Load(util.UnsafeBytesToString(id)); !ok {
if value, ok := mgr.IDMap.Load(util.UnsafeBytesToString(id)); ok {
txn = value.(txnif.AsyncTxn)
} else {
store := mgr.TxnStoreFactory()
txn = mgr.TxnFactory(mgr, store, id, ts, ts)
store.BindTxn(txn)
Expand Down

0 comments on commit 2fed24b

Please sign in to comment.