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

Galera cluster sequence with increment of 0 does not proper increments when nextval is called on the sequence, after a node a stopped working

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 10.3.17
    • Fix Version/s: 10.3
    • Component/s: Galera
    • Labels:
      None
    • Environment:
      centos

      Description

      The Nextval command for sequences, where the increment is defined as 0, using multiple nodes with Galera, does not seem to work properly when nodes are stopped and restarted.
      If a node fails, the auto_increment_increment and auto_increment_offset values are updated properly. However, the actual nextval(sequence) command will continue to provide the previous (and now erroneous) increment.
      So if you have three nodes and one fails, applying nextval to a sequence on the other two nodes will continue to provide increments of 3 even though there are only two active nodes. However, if you shutdown a second node, and then restart it, it will begin providing a nextval with the right increment of 2. So now you have two active nodes, one node giving nextval increments of 2 and another with nextval increments of 3. If you restart the third node, you will have two nodes giving increments of 3 and one node giving nextval increments of 2!

      This may not cause any key collisions as long as each node takes it's own value cache, and updates the sequence's next_not_cached_value parameter. So if the sequence's cache is set to 1000 each node takes an independent cache of 1000 values and updates the next_not_cached_value parameter. However this then puts into question why the auto_increment_increment option even exists for sequences.

        Attachments

          Activity

            People

            Assignee:
            ramesh Ramesh Sivaraman
            Reporter:
            danieloren Daniel Oren
            Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated: