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

In Galera Cluster, when init gtid does not get domain_id and server_id from mariadb.cnf

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • linux

    Description

      1. sql\wsrep_mysqld.cc
      void wsrep_init_globals()
      {
      wsrep_gtid_server.domain_id= wsrep_gtid_domain_id;
      wsrep_init_sidno(Wsrep_server_state::instance().connected_gtid().id());
      wsrep_init_gtid();
      ......

      void wsrep_init_gtid()
      {
      wsrep_server_gtid_t stored_gtid= wsrep_get_SE_checkpoint<wsrep_server_gtid_t>();
      if (stored_gtid.server_id == 0)
      {
      rpl_gtid wsrep_last_gtid;
      stored_gtid.domain_id= wsrep_gtid_server.domain_id;
      if (mysql_bin_log.is_open() &&
      mysql_bin_log.lookup_domain_in_binlog_state(stored_gtid.domain_id,
      &wsrep_last_gtid))

      { stored_gtid.server_id= wsrep_last_gtid.server_id; stored_gtid.seqno= wsrep_last_gtid.seq_no; }

      else

      { stored_gtid.server_id= global_system_variables.server_id; stored_gtid.seqno= 0; }

      }
      wsrep_gtid_server.gtid(stored_gtid);
      }

      2. sql\wsrep_xid.cc
      template<>
      wsrep_server_gtid_t wsrep_get_SE_checkpoint()
      {
      XID xid;
      wsrep_server_gtid_t gtid=

      {0,0,0}

      ;

      if (!wsrep_get_SE_checkpoint_common(xid))

      { return gtid; }

      if (xid.data[WSREP_XID_VERSION_OFFSET] == WSREP_XID_VERSION_3)

      { memcpy(&gtid, &xid.data[WSREP_XID_RPL_GTID_OFFSET], sizeof(wsrep_server_gtid_t)); }

      return gtid;
      }

      3. In function wsrep_get_SE_checkpoint, domain_id and server_id were from engine, and were set to gtid.
      In function wsrep_init_gtid , stored_gtid.server_id was not equal to 0. But domain_id and server_id in mariadb.cnf were not same as stored_id.

      4. Backup data from cluster1 with mariabackup, and then restore data to cluster2. So the GTID domain_id and server_id become same.
      GTID : <domain_id> - <server_id> - <seqno>

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              derry derry
              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.