diff --git a/store/driver/txn/txn_driver.go b/store/driver/txn/txn_driver.go index 79631d7e5a187..8e8d776eea982 100644 --- a/store/driver/txn/txn_driver.go +++ b/store/driver/txn/txn_driver.go @@ -163,7 +163,7 @@ func (txn *tikvTxn) SetOption(opt int, val interface{}) { case tikvstore.Enable1PC: txn.SetEnable1PC(val.(bool)) case tikvstore.GuaranteeLinearizability: - txn.SetCasualConsistency(!val.(bool)) + txn.SetCausalConsistency(!val.(bool)) case tikvstore.TxnScope: txn.SetScope(val.(string)) case tikvstore.IsStalenessReadOnly: diff --git a/store/tikv/tests/async_commit_test.go b/store/tikv/tests/async_commit_test.go index 77701687e448b..f67482e69a44e 100644 --- a/store/tikv/tests/async_commit_test.go +++ b/store/tikv/tests/async_commit_test.go @@ -126,7 +126,7 @@ func (s *testAsyncCommitCommon) mustGetNoneFromSnapshot(c *C, version uint64, ke func (s *testAsyncCommitCommon) beginAsyncCommitWithLinearizability(c *C) tikv.TxnProbe { txn := s.beginAsyncCommit(c) - txn.SetCasualConsistency(false) + txn.SetCausalConsistency(false) return txn } diff --git a/store/tikv/tests/snapshot_fail_test.go b/store/tikv/tests/snapshot_fail_test.go index 46690fbfcfc8a..9892061c44b8d 100644 --- a/store/tikv/tests/snapshot_fail_test.go +++ b/store/tikv/tests/snapshot_fail_test.go @@ -213,7 +213,7 @@ func (s *testSnapshotFailSuite) TestRetryPointGetResolveTS(c *C) { c.Assert(err, IsNil) txn.SetEnableAsyncCommit(false) txn.SetEnable1PC(false) - txn.SetCasualConsistency(true) + txn.SetCausalConsistency(true) // Prewrite the lock without committing it c.Assert(failpoint.Enable("github.com/pingcap/tidb/store/tikv/beforeCommit", `pause`), IsNil) diff --git a/store/tikv/txn.go b/store/tikv/txn.go index e087b8e03af68..baeaa6b7fa508 100644 --- a/store/tikv/txn.go +++ b/store/tikv/txn.go @@ -284,10 +284,10 @@ func (txn *KVTxn) SetEnable1PC(b bool) { txn.enable1PC = b } -// SetCasualConsistency indicates if the transaction does not need to +// SetCausalConsistency indicates if the transaction does not need to // guarantee linearizability. Default value is false which means // linearizability is guaranteed. -func (txn *KVTxn) SetCasualConsistency(b bool) { +func (txn *KVTxn) SetCausalConsistency(b bool) { txn.causalConsistency = b }