skip to Main Content

I have noticed that in my mysql server, the auto_increment setting increments by 3, for example 3 6 9 12 15 etc.

All the tables in the database are having the same problem.

I’m using mariadb 10.5 on debian 10.

Could it be because of having a 3 vps galley cluster?

MariaDB [(none)]> SHOW VARIABLES LIKE 'auto_inc%';
+--------------------------+-------+
| Variable_name            | Value |
+--------------------------+-------+
| auto_increment_increment | 3     |
| auto_increment_offset    | 1     |
+--------------------------+-------+
2 rows in set (0.002 sec)

2

Answers


  1. If you are actually using Galera, then auto_increment_increment needs to be 3 (or however many nodes (servers) are in the cluster).

    SHOW VARIABLES LIKE 'wsrep%';

    Login or Signup to reply.
  2. They designed it to be like that. You could say that it is a limitation of using Galera. They made it like that to address the collision issue when generating sequential numbers as primary key during inserts in a Multi-Master cluster.

    https://mariadb.org/auto-increments-in-galera/

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search