Amazon Aurora MYSQL AUTO_INCREMENT sometimes gets out of sync on read and write replicas.

0

I have +20 RDS Aurora MYSQL clusters, each with a read and write replica. On each of these clusters I have many databases (thousands), and on each database I have a of table like this:

CREATE TABLE `projects` (
	`id` INT(11) NOT NULL AUTO_INCREMENT,...

Sometimes, the AUTO_INCREMENT value of this table gets out of sync on the read and write replica.

An example:

autoincrement issue

and another example:

autoincrement issue

When this happens, on insert, I get errors like this

Caused by: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '214' for key 'PRIMARY'

Caused by: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '16' for key 'PRIMARY'

The only fix available is a cluster failover, that is switch read and writer replicas. After failover the values are synchronized and the insert works.

Does anyone else have this issue? Is this the right place to post this issue so that the AWS developers know about and maybe fix it?

No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions