Not the answer you need?
Register and ask your own question!

Duplicate Primary Key Error with Percona Cluster

MeirWMeirW EntrantCurrent User Role Beginner
We recently setup our database with a Galera Cluster.
I have been getting the following errors every few hours:
Duplicate entry 'XXXXXXX' for key 'PRIMARY'

This occurs with a number of tables, all using InnoDB.

We are using 3 machines in our cluster.
a. Master
b. Master
c. Backup - in case a SST is needed or the other two go down.

wsrep_auto_increment_control is ON.
innodb_autoinc_lock_mode is set to 2 (as the Percona documentation says this is mandatory).

What is causing it?
What can we do about it, without using only one Database for writes?

Thanks is advance.


  • guillaume.houdmonguillaume.houdmon Entrant Inactive User Role Beginner
    I have the same issue with the same architecture.
    Did you find the source of your problem or a workaround?
  • przemekprzemek Percona Support Engineer Percona Staff Role
    Can you show an example of such transaction together with table definition? And paste my.cnf. Do you use any MyISAM tables?
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.