When you are using an instance as part of an InnoDB Cluster,
the auto_increment_increment
and auto_increment_offset
variables are configured to avoid the possibility of auto
increment collisions for multi-primary clusters up to a size of
9 (the maximum supported size of a Group Replication group). The
logic used to configure these variables can be summarized as:
If the group is running in single-primary mode, then set
auto_increment_increment
to 1 andauto_increment_offset
to 2.If the group is running in multi-primary mode, then when the cluster has 7 instances or less set
auto_increment_increment
to 7 andauto_increment_offset
to 1 +server_id
% 7. If a multi-primary cluster has 8 or more instances setauto_increment_increment
to the number of instances andauto_increment_offset
to 1 +server_id
% the number of instances.