{question}
What should I do when receiving the following error when trying to insert a new record:
Leaf Error: Duplicate entry 'VALUE' for key 'PRIMARY'
{question}
{answer}
When trying to insert a record into a table where the auto_increment has become unsynchronized between the aggregators, you receive the following error:
Table DDL:
CREATE TABLE `tableTest` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`description` varchar(50) DEFAULT NULL
);
Insert statement:
INSERT INTO tableTest (description) VALUES ('Description');
Error received.
SQL Error [1062] [23000]: Leaf Error (10.0.0.12:3306):
Duplicate entry '143' for key 'PRIMARY'
If you would like to know more, you can review our Documentation.
To fix the issue, you will need to set the auto-increment counter on the aggregators with the following command
AGGREGATOR SYNC AUTO_INCREMENT ON <database>.<table>
{answer}