Error 1105 when using analyze table - commit TS must be greater or equal

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

Original topic: 使用analyze表的时候报错1105 - commit TS must be greater or equal

| username: Jjjjayson_zeng

[TiDB Usage Environment] Production Environment
[TiDB Version]
[Reproduction Path] What operations were performed when the issue occurred
[Encountered Issue: Issue Phenomenon and Impact]
[Resource Configuration] Go to TiDB Dashboard - Cluster Info - Hosts and take a screenshot of this page
[Attachment: Screenshot/Logs/Monitoring]

| username: Billmay表妹 | Original post link

This error is usually caused by the transaction timestamp (commit TS) in TiDB being less than or equal to the current system timestamp. In TiDB, transaction timestamps are used to ensure data consistency and isolation. When executing the ANALYZE TABLE statement, TiDB generates a new transaction and assigns a timestamp to it. However, if this timestamp is less than or equal to the current system timestamp, the error will be triggered.

To resolve this issue, you can try the following steps:

  1. Ensure that your system time is accurate. Check the system time on both TiDB and TiKV nodes and make sure they are consistent with the actual time.
  2. If your system time is correct but you still encounter this error, try restarting the TiDB and TiKV nodes. Sometimes, restarting the nodes can resolve timestamp synchronization issues.
  3. If the problem persists, check the tikv-client.commit-timestamp parameter in the TiDB configuration file. Ensure that the value of this parameter is greater than the current system timestamp.

If you continue to experience issues, I recommend consulting the TiDB official documentation on the ANALYZE TABLE section for more detailed information and solutions regarding this error.

| username: Jjjjayson_zeng | Original post link

The time can be confirmed as accurate.

| username: Jjjjayson_zeng | Original post link

In a production environment, you cannot restart casually.

| username: h5n1 | Original post link

Are the times of each host in the TiDB cluster synchronized? Theoretically, the TSO allocated by PD will not roll back.

| username: Jjjjayson_zeng | Original post link

Can you explain how to view it? Because I’m not a DBA and don’t have permissions, it would be best to have an article for them to read.

| username: Billmay表妹 | Original post link

Let them come to the community and ask questions themselves~

| username: WalterWj | Original post link

Use these two commands to get the natural time of TSO in PD, then use select now to check the current time of the TiDB server and compare.

| username: 芮芮是产品 | Original post link

Jun’s method is correct.

| username: h5n1 | Original post link

Try setting tidb_enable_async_commit=off at the session level and then re-execute the statistics collection.

| username: h5n1 | Original post link

tidb_enable_1pc=off Try adding this to the session as well.

| username: andone | Original post link

Recollect statistics

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.