Skip to content

Commit

Permalink
cherry pick #4959 to release-4.0 (#4989)
Browse files Browse the repository at this point in the history
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>

Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com>
  • Loading branch information
ti-srebot and TomShawn authored Mar 9, 2021
1 parent 7384b4c commit a5e6ed0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion optimistic-transaction.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit a5e6ed0

Please sign in to comment.