0

I posted a similar question a bit earlier but I was a bit confused because of the settings already set and by reading this http://mariadb.org/auto-increments-in-galera/ I totally understand and corrected the settings but from what I read the output of the auto increment id will be like

both nodes are increment of 2

node 1 with offset 1 1,3,5,7

node 2 with offset 2 2,4,6,8

but when I create new rows...this happens

create with node 1, node 1, node 2 would give me 1,3,4 it wouldn't give me 2

create with node 1, node 2, node 1, node 2 would give me 1,2,3,4

I am just wondering if this kind of reaction is considered as normal or there is something I am missing that I should correct?

Thanks in advance

Dora
  • 6,776
  • 14
  • 51
  • 99

1 Answers1

0

Galera is designed for both nearly-synchronous replication and speed. There are tradeoffs. You have uncovered one of them. I suspect a similar "gap" can be found in the old dual-Master replication.

Live with it!

AUTO_INCREMENT values are guaranteed to be unique. Period. Full stop. There are a lot of other attributes that you might like, but you cannot assume them.

Another doc: https://mariadb.com/kb/en/library/tips-on-converting-to-galera/#auto_increment

Rick James
  • 135,179
  • 13
  • 127
  • 222