[MDEV-17465] in galera cluster, Create Sequence's INCREMENT option must be updated, because nextval() function is occuring a Duplicate entry Error Created: 2018-10-16  Updated: 2021-04-26  Resolved: 2019-05-13

Status: Closed
Project: MariaDB Server
Component/s: Galera, Sequences
Affects Version/s: 10.3
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Seonghwan Kim Assignee: Jan Lindström (Inactive)
Resolution: Not a Bug Votes: 0
Labels: galera, sequences


 Description   

Hi,
I found some missing function in Sequence.

in galera cluster, Create Sequence's INCREMNET option must be updated, because nextval() function is occuring a Duplicate entry Error.

when using 2-node Galera Cluster,
create sequence s33 increment=0;
create table tbs33 (i int primary key default nextval(s33), b int);

insert into tbs33 (b) values(111);
insert into tbs33 (b) values(222);
........

sometime after,
Another Node is Joined in Galera Cluster,(now 3-node)
then cluster occuring a error, like below.
ERROR 1062 (23000): Duplicate entry '31' for key 'PRIMARY'

I thought Sequence function must be updated.
If New cluster node is joined, Sequece function also modified, along with joined node.

See below description.
https://mariadb.com/kb/en/library/create-sequence/
'Setting an increment of 0 causes the sequence to use the value of the auto_increment_increment system variable at the time of creation, which is always a positive number.'

[...at the time of creation...]
I think it will be updated like below
[...at the time of creation... And will be updated along with joined cluster node.]

Galera Cluster's node flexibility is not reflecting in recent version of MariaDB Sequecne engine.
Thank you.



 Comments   
Comment by Elena Stepanova [ 2018-10-16 ]

monty, serg, jplindst, what do you think about this? The complaint seems reasonable from the normal-user-scenario point-of-view, but I suppose the change might cause weird unwanted consequences and side effects.
Assigned to jplindst just so somebody owns it. When a decision is made, please reassign to whoever it belongs, based on the decision.

Comment by Jan Lindström (Inactive) [ 2019-05-13 ]

Based on description sequence works as designed and documented. When a new Galera node joins a cluster it does either incremental or full state transfer. This means that this joiner will copy database state from one of the nodes i.e. donor meaning that database objects are not created. For sequence case if setting the initial value is important user can use alter sequence for it.

Generated at Thu Feb 08 08:36:40 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.