Skip to content

Commit 9b20925

Browse files
Update docs/design/2024-01-22-ticdc-large-txn-not-block-wm.md
Co-authored-by: CharlesCheung <[email protected]>
1 parent b46c57b commit 9b20925

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/design/2024-01-22-ticdc-large-txn-not-block-wm.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Because the total write data is massive in the prewrite stage for a large transa
5353
## Mechanism of updating primary key TTL periodically for large transaction
5454

5555
In TiDB's 2PC transaction protocol, TiDB prewrites all kv pairs concurrently at the prewrite stage, and then commit the primary key first and then asynchrously commit all secondary keys. If a read request encountered a prewritten but uncommitted data, it will try to check its primary key's status(committed or rollbacked, or still ongoing) to determine wait the data to be committed or rollback it. The read request uses the TTL information enveloped in the primary key to determine if this is an aborted transaction caused by crashed TiDB instances or if this is an ongoing transaction if the TTL is still alive.
56-
For a normal transaction, the default TTL is 3s ahead of the transaction's start-ts. It means if a read request encounters a lock whose primary key's status is undertimed, the read request will check the TTL of this primary key. If the TTL is less than the read request's current ts, the read request can rollback this undertermined lock to make this read request unblocked.
56+
For a normal transaction, the default TTL is 3s ahead of the transaction's start-ts. It means if a read request encounters a lock whose primary key's status is undetermined, the read request will check the TTL of this primary key. If the TTL is less than the read request's current ts, the read request can rollback this undetermined lock to make this read request unblocked.
5757
In order to prevent the read request and other lock resolving mechanisms disturbing or aborting a long running large transaction, the large transaction will periodically update and advance the TTL of its primary key. The following diagram demostrate how large transaction update TTL of its primary key:
5858

5959
![image](../media/large-txn-no-block-wm-2.png)

0 commit comments

Comments
 (0)