When you are using an instance as part of an InnoDB Cluster, theauto_increment_increment andauto_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_incrementto 1 andauto_increment_offsetto 2.If the group is running in multi-primary mode, then when the cluster has 7 instances or less set
auto_increment_incrementto 7 andauto_increment_offsetto 1 +server_id% 7. If a multi-primary cluster has 8 or more instances setauto_increment_incrementto the number of instances andauto_increment_offsetto 1 +server_id% the number of instances.