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

Database sequence value decreased after MariaDB upgrade

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.6.22, 10.11.15
    • 10.11
    • Galera
    • None

    Description

      Our environment is mariadb galera cluster with 3 nodes (node1 +node2+witness), Current db version is 10.6.22, while we performed rolling upgrade, patching node2 to 10.11.15 first, Keeping node1 still 10.6.22
      Then when completed node2 patching upgrade, and switch application traffic direction to node2, Encountered the very serious problem , the database sequence value decreased huge, by the way, our traffic are always direction to node1 at past:

      • sequence: seq_abc_obj_xxx_id
      • value at node1(10.6.22) not DB upgrade: > 7,635,954
      • value at node2(10.11.15) after upgrade: <* 1,770,744*

      #1. show create table seq_abc_obj_xxx_id : the desc is same as node1 and node2
      CREATE TABLE `seq_abc_obj_xxx_id` (
      `next_not_cached_value` bigint(21) NOT NULL,
      `minimum_value` bigint(21) NOT NULL,
      `maximum_value` bigint(21) NOT NULL,
      `start_value` bigint(21) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used',
      `increment` bigint(21) NOT NULL COMMENT 'increment value',
      `cache_size` bigint(21) unsigned NOT NULL,
      `cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed',
      `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done'
      ) ENGINE=InnoDB SEQUENCE=1

      show parameter
      MariaDB [tdidpprd]> show variables like '%incre%';
      -----------------------------------+

      Variable_name Value

      -----------------------------------+

      auto_increment_increment 1
      auto_increment_offset 1
      div_precision_increment 4
      innodb_autoextend_increment 64
      wsrep_auto_increment_control OFF

      -----------------------------------+

      #node1:
      MariaDB [tdidpprd]> select * from seq_abc_obj_xxx_id;
      ------------------------------------------------------------------------------------------------------------+

      next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count

      ------------------------------------------------------------------------------------------------------------+

      7635954 1 9223372036854775806 1 0 0 0 0

      ------------------------------------------------------------------------------------------------------------+

      node2:
      MariaDB [tdidpprd]> select * from seq_abc_obj_xxx_id;
      ------------------------------------------------------------------------------------------------------------+

      next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count

      ------------------------------------------------------------------------------------------------------------+

      1770744 1 9223372036854775806 1 0 0 0 0

      ------------------------------------------------------------------------------------------------------------+
      1 row in set (0.000 sec)

      Attachments

        Activity

          People

            janlindstrom Jan Lindström
            johngou johngou
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.