New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refine docs: troubleshoot lock conflicts #9865
Refine docs: troubleshoot lock conflicts #9865
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rest LGTM
pessimistic-transaction.md
Outdated
The pessimistic transaction adds an `Acquire Pessimistic Lock` phase before 2PC. This phase includes the following steps: | ||
|
||
1. (Same as the optimistic transaction mode) Receive the `begin` request from the client, and the current timestamp is this transaction's start_ts. | ||
2. When the TiDB server receives an `update` request from the client, the TiDB server initiates a pessimistic lock request to the TiKV server, and the lock is persisted to the TiKV server. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be talking about "writing new data", rather than talking about update
statements specifically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MyonKeminta Please check if the following update is ok. Thanks.
pessimistic-transaction.md
Outdated
@@ -139,6 +139,20 @@ TiDB supports the following two isolation levels in the pessimistic transaction | |||
|
|||
- [Read Committed](/transaction-isolation-levels.md#read-committed-isolation-level). You can set this isolation level using the [`SET TRANSACTION`](/sql-statements/sql-statement-set-transaction.md) statement. | |||
|
|||
## Pessimistic transaction commit process | |||
|
|||
The commit phase of the pessimistic transaction mode and the optimistic transaction mode in TiDB has the same logic, and both commits are in the 2PC mode. The important adaptation of pessimistic transactions is DML execution. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commit phase of the pessimistic transaction mode and the optimistic transaction mode in TiDB has the same logic, and both commits are in the 2PC mode. The important adaptation of pessimistic transactions is DML execution. | |
The commits of the pessimistic transactions and the optimistic transactions in TiDB have the same logic. Both transactions adopt the two-phase commit (2PC) mode. The important adaptation of pessimistic transactions is DML execution. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing "the commit phase" to "commits" doesn't make sense to me. Here it's supposed to stands for the commit operation of a transaction. What we want to say here is 悲观事务和乐观事务的提交阶段逻辑相同.
Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rest LGTM
Co-authored-by: MyonKeminta <9948422+MyonKeminta@users.noreply.github.com>
/remove-status LGT1 |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 112ea3a
|
In response to a cherrypick label: new pull request created: #10589. |
In response to a cherrypick label: new pull request created: #10590. |
In response to a cherrypick label: new pull request created: #10591. |
In response to a cherrypick label: new pull request created: #10592. |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
In response to a cherrypick label: new pull request created: #10593. |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
First-time contributors' checklist
What is changed, added or deleted? (Required)
Which TiDB version(s) do your changes apply to? (Required)
Tips for choosing the affected version(s):
By default, CHOOSE MASTER ONLY so your changes will be applied to the next TiDB major or minor releases. If your PR involves a product feature behavior change or a compatibility change, CHOOSE THE AFFECTED RELEASE BRANCH(ES) AND MASTER.
For details, see tips for choosing the affected versions.
What is the related PR or file link(s)?
Do your changes match any of the following descriptions?