Today, TiDB discovered that the auto-increment primary key of a table suddenly jumped from 718 to 3001, and then this error was found

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

Original topic: tidb今天发现一个表的自增主键从718突变到3001开始,然后发现了这个错误

| username: liujq132

[TiDB Usage Environment] Production Environment / Testing / PoC
[TiDB Version] 6.1.1
[Reproduction Path] What operations were performed that led to the issue
[Encountered Issue: Issue Phenomenon and Impact]
(8028, ‘Information schema is changed during the execution of the statement (for example, table definition may be updated by other DDL ran in parallel). If you see this error often, try increasing tidb_max_delta_schema_count. [try again later]’)
(8027, ‘Information schema is out of date: schema failed to update in 1 lease, please make sure TiDB can connect to TiKV’)
[Resource Configuration]
[Attachments: Screenshots / Logs / Monitoring]

| username: Billmay表妹 | Original post link

What is the complete error message?

What actions led to it?

| username: liujq132 | Original post link

How to view the complete error message, this is returned by python’s pymysql.

| username: zhanggame1 | Original post link

This prompt seems to indicate that the network connection between TiDB and TiKV was interrupted for a moment.

| username: Billmay表妹 | Original post link

Check if your TiDB can connect to TiKV.

The table definition might be updated by other DDL operations running in parallel. Try: tidb_max_delta_schema_count.

| username: 我是咖啡哥 | Original post link

  1. Clearly describe the context, and include some code if necessary;
  2. Check the TiDB status and review the relevant logs to see if there are any abnormal errors;
  3. Retry to see if the issue still exists. Is it occasional or frequent?
| username: Hacker_xUwtuKxa | Original post link

Following up, does the change in the auto-increment primary key value frequently modify the table definition? Even if it does, it should be periodic rather than modifying it every time a value is added. Is this table highly dynamic? Are there any other log outputs?