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

gtid_current_pos is not updated with slave transactions from old master

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 10.1.14
    • Fix Version/s: 10.2
    • Component/s: Replication
    • Labels:
      None

      Description

      Hi everybody,

      According to the documentation, the gtid_current_pos should be updated with transactions from the slave threads as well:
      https://mariadb.com/kb/en/mariadb/gtid/#gtid_current_pos

      While this is not a problem in traditional replication setups (we can use slave_pos instead of current_pos) it can be a problem with setups with intermediate masters where the higher master is older version:
      Server 1 (5.5) -> Server 2a (10.1) -> server 2b (10.1)

      If we want to switch roles between 2a and 2b we stop replication from server 1 to 2a (to failover afterwards). However we cannot use gtid_slave_pos or gtid_current_pos because they are not updated:

      MariaDB [mariadb]> select @@gtid_binlog_pos, @@gtid_slave_pos, @@gtid_current_pos;
      +------------------------+--------------------------+--------------------------+
      | @@gtid_binlog_pos      | @@gtid_slave_pos         | @@gtid_current_pos       |
      +------------------------+--------------------------+--------------------------+
      | 0-201-55312,1-1-113229 | 0-201-55312,1-102-110354 | 0-201-55312,1-102-110354 |
      +------------------------+--------------------------+--------------------------+
      1 row in set (0.00 sec)
      

      If we perform a transaction on server 2a the current_pos at least is updated:

      MariaDB [mariadb]> insert into test values(NULL);
      Query OK, 1 row affected (0.01 sec)
       
      MariaDB [mariadb]> select @@gtid_binlog_pos, @@gtid_slave_pos, @@gtid_current_pos;
      +--------------------------+--------------------------+--------------------------+
      | @@gtid_binlog_pos        | @@gtid_slave_pos         | @@gtid_current_pos       |
      +--------------------------+--------------------------+--------------------------+
      | 0-201-55312,1-101-113230 | 0-201-55312,1-102-110354 | 0-201-55312,1-101-113230 |
      +--------------------------+--------------------------+--------------------------+
      1 row in set (0.00 sec)
      

      Please make it so that current_pos (and slave_pos?) is also updated from transaction that come in from old master, as the documentation states.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Elkin Andrei Elkin
              Reporter:
              michaeldg Michaël de groot
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated: