Hello.

I have a project where I need some generated integers to be incremented strictly by 1 in ascending order. Will it be for ID columns or some other columns.

Because I use mariadb with galera cluster in multi-master mode I had the idea to use sequences:

create sequence "table_id_seq" as bigint unsigned increment by 1 nocache nocycle;

While inserting on one node did do the scope, I came to that despite the sequences are represented as Innodb tables, the next_not_cached_value are not synchronized with other nodes. So if the insertions switches to another node in cluster, the generated IDs are same as already inserted.

Some one can explain me why the sequence doesn't work as I expected, and how can I achieve the goal of having exactly ascending integers with increment by 1 in syncing on all galera nodes?


Thank you.
_______________________________________________
discuss mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to