Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-17465

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

    XMLWordPrintable

    Details

      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.

        Attachments

          Activity

            People

            Assignee:
            jplindst Jan Lindström
            Reporter:
            Seonghwan Kim Seonghwan Kim
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: