In a certain replication setup I have created multi-master replication in STAR topology using MariaDB. I have an unknown number of 'client-masters', so I have set the auto_increment_increment to 30 and the auto_increment_offset accordingly. When I go over the 30 masters, this system is going to crash, so I would like the following:
The Auto-increment value is created by using the following calculation:
auto_increment_offset + N × auto_increment_increment
Is it possible to make the auto-increment-increment dynamic like this:
(SELECT COUNT(id) FROM Clients) + N x (SELECT COUNT(id) FROM Clients)
When I add a client to the table, the other clients will automatically be upping the increment.
to be on the safe side I probably should add a buffer:
(SELECT COUNT(id) FROM Clients) + N x ((SELECT COUNT(id) FROM Clients) + 5)
Can anyone tell me if this could be done, or if there is another way to accomplish this?