[MDEV-27120] Sequence does not follow new auto_increment_offset after another restart Created: 2021-11-24 Updated: 2022-10-04 Resolved: 2022-10-03 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Galera |
| Affects Version/s: | 10.5 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | William Wong | Assignee: | Jan Lindström (Inactive) |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Redhat on VMware |
||
| Description |
|
We found sequence object generate same number from 2 Galera nodes. The increment setting is 0. After checking, the behavior happens after one DB restart gracefully. Below is from an example, DB node auto_increment_offset=3 and sequence object uses formula : 3 x N +3. Sample values are 9102 , 9105. When we restart another DB node. auto_increment_offset of this node got updated to 2. But sequence object still keep using original offset 3 and still generate number 9108 which is using offset 3. Workaround is setting offset manually MariaDB [(none)]> show variables like 'auto_increment%' ;
-------------------------
------------------------- MariaDB [(none)]>
---------------------
--------------------- MariaDB [(none)]> select nextval(testdb1.s1) ;
---------------------
--------------------- MariaDB [(none)]>
-------------------------
------------------------- MariaDB [(none)]>
---------------------
--------------------- MariaDB [(none)]> |
| Comments |
| Comment by William Wong [ 2021-11-25 ] |
|
Additional comment of DB parameters when issue happens wsrep_auto_increment_control=ON |
| Comment by Jan Lindström (Inactive) [ 2022-10-03 ] |
|
Works as designed. If wsrep_auto_increment_control is ON it means that increment is same as number of nodes in the cluster and offset is node wsrep_node_index + 1. If you do not want wsrep to handle these automatically set wsrep_auto_increment_control=OFF; |
| Comment by William Wong [ 2022-10-04 ] |
|
Hi Jan, The problem is below : DB sessions keep using old offset while auto_increment_offset is changed already. As a result, the whole cluster cannot guarantee unique sequence among DB nodes. Regards, |
| Comment by Jan Lindström (Inactive) [ 2022-10-04 ] |
|
frelist auto_increment_offset problem will be fixed on |