Skip to content

Commit

Permalink
new syntax overrides sysvar
Browse files Browse the repository at this point in the history
Signed-off-by: ekexium <[email protected]>
  • Loading branch information
ekexium committed Feb 3, 2021
1 parent 4c92eac commit b639100
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion session/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,10 @@ func (s *session) doCommit(ctx context.Context) error {
}
s.txn.SetOption(kv.EnableAsyncCommit, s.GetSessionVars().EnableAsyncCommit)
s.txn.SetOption(kv.Enable1PC, s.GetSessionVars().Enable1PC)
s.txn.SetOption(kv.GuaranteeExternalConsistency, s.GetSessionVars().GuaranteeExternalConsistency)
// priorify of the sysvar is lower than `start transaction with causal consistency`
if s.txn.GetUnionStore().GetOption(kv.GuaranteeExternalConsistency) == nil {
s.txn.SetOption(kv.GuaranteeExternalConsistency, s.GetSessionVars().GuaranteeExternalConsistency)
}

return s.txn.Commit(sessionctx.SetCommitCtx(ctx, s))
}
Expand Down

0 comments on commit b639100

Please sign in to comment.