From a5e6ed0c6635b4337ed5627ee315e0f87c70c558 Mon Sep 17 00:00:00 2001 From: ti-srebot <66930949+ti-srebot@users.noreply.github.com> Date: Tue, 9 Mar 2021 16:02:20 +0800 Subject: [PATCH] cherry pick #4959 to release-4.0 (#4989) Signed-off-by: ti-srebot Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- optimistic-transaction.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/optimistic-transaction.md b/optimistic-transaction.md index e90f6598222b9..7eddbb54e1875 100644 --- a/optimistic-transaction.md +++ b/optimistic-transaction.md @@ -40,7 +40,7 @@ To support distributed transactions, TiDB adopts two-phase commit (2PC) in optim 1. TiDB selects a Primary Key from the data to be written. 2. TiDB receives the information of Region distribution from PD, and groups all keys by Region accordingly. 3. TiDB sends prewrite requests to all TiKV nodes involved. Then, TiKV checks whether there are conflict or expired versions. Valid data is locked. - 4. TiDB receives all requests in the prewrite phase and the prewrite is successful. + 4. TiDB receives all responses in the prewrite phase and the prewrite is successful. 5. TiDB receives a commit version number from PD and marks it as `commit_ts`. 6. TiDB initiates the second commit to the TiKV node where Primary Key is located. TiKV checks the data, and cleans the locks left in the prewrite phase. 7. TiDB receives the message that reports the second phase is successfully finished.