Commit_ts is too large, fallback to normal 2PC

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: commit_ts is too large, fallback to normal 2PC

| username: anafin

【TiDB Environment】Production
【TiDB Version】5.4.2
Upstream is TiDB, synchronized via TiCDC
【Encountered Issue】Frequent occurrences
[2022/07/29 18:40:19.936 +08:00] [WARN] [prewrite.rs:613] [“commit_ts is too large, fallback to normal 2PC”] [lock=“Lock { lock_type: Put, primary_key: 748000000000000AC95F698000000000000001038000000000000C32017370303030303233FF3739330000000000FA03800000000460A17A, start_ts: TimeStamp(434920802697347099), ttl: 23394, short_value: 30, for_update_ts: TimeStamp(0), txn_size: 1, min_commit_ts: TimeStamp(434920808031977475), use_async_commit: true, secondaries: , rollback_ts: }”] [max_commit_ts=434920808567799835] [min_commit_ts=434920808752873488] [start_ts=434920802697347099] [key=748000000000000AFFC95F698000000000FF0000010380000000FF00001D7B01535048FF3030303437FF3830FF320000000000FA03FF80000000047CBE52FF0000000000000000F7]

| username: h5n1 | Original post link

It is speculated that in the case of 1PC or async commit, during Prewrite, the min_commit_ts is calculated based on the written key, and the largest one is chosen as the commit_ts. To ensure schema consistency between start_ts and commit_ts, TiDB adds a max_commit_ts, which is calculated as Prewrite + 2 seconds. When min_commit_ts exceeds max_commit_ts, a commitTStoolarge error is reported, and it falls back to the 2PC commit mode. It might be caused by a longer Prewrite time.

| username: anafin | Original post link

The hardware configuration of this database is slightly lower than the upstream, and the execution is slower than the upstream. Which parameter can be adjusted to extend it appropriately?

| username: h5n1 | Original post link

Check the system load, especially the disk pressure downstream, the CPU utilization of raft-related threads, and the network latency between components. Export the monitoring data as shown below, and make sure all panels are expanded before exporting:
https://metricstool.pingcap.com/#backup-with-dev-tools

| username: system | Original post link

This topic will be automatically closed 60 days after the last reply. No new replies are allowed.