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?

Nessuna risposta

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande