Solutions for Auto_Increment Conflicts

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

Original topic: auto_increment冲突的解决办法

| username: Qiuchi

When using auto_increment, manually inserting some data caused a conflict in the cached ID range, resulting in the failure of the auto_increment ID. How should this situation be handled? When restarting TiDB, will it re-cache the ID range by querying the current maximum ID to obtain a non-conflicting range?

ALTER TABLE auto_increment_test
    AUTO_INCREMENT = 1000000;
| username: 啦啦啦啦啦 | Original post link

Normally, a write conflict will only occur once. The TiDB server can automatically obtain the maximum ID of the table to update the cache, and of course, a restart can also do this.

| username: Qiuchi | Original post link

Previously, I encountered repeated conflicts for some unknown reason. Each time the ID increased by 1, but a new range was not taken. However, there were also instances where a conflict was resolved in one go. There are three TiDB instances.

| username: system | Original post link

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