Skip to content

Commit

Permalink
*: fix data race in the baseTxnContextProvider.ActivateTxn
Browse files Browse the repository at this point in the history
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
  • Loading branch information
hawkingrei committed Apr 12, 2023
1 parent 8b7b310 commit 762d3f2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sessiontxn/isolation/base.go
Expand Up @@ -288,7 +288,9 @@ func (p *baseTxnContextProvider) ActivateTxn() (kv.Transaction, error) {
}

sessVars := p.sctx.GetSessionVars()
sessVars.TxnCtxMu.Lock()
sessVars.TxnCtx.StartTS = txn.StartTS()
sessVars.TxnCtxMu.Unlock()
if sessVars.MemDBFootprint != nil {
sessVars.MemDBFootprint.Detach()
}
Expand Down

0 comments on commit 762d3f2

Please sign in to comment.