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?

smatei
preguntada hace un año116 visualizaciones
No hay respuestas

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas