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

Partitioned table DML sometimes binlogged without XID event

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • None
    • None
    • None
    • None

    Description

      Note in the output below that the last INSERT in the binlog has a COMMIT query
      event at the end, not a XID event. This is wrong, for one it could cause
      failure to crash recover the binlog with InnoDB.

      Test case:

      --source include/have_innodb.inc
      --source include/have_partition.inc
      --let $rpl_topology=1->2
      --source include/rpl_init.inc
       
      --connection server_2
      SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
      --source include/stop_slave.inc
      SET GLOBAL slave_parallel_threads=10;
      --source include/start_slave.inc
       
      --connection server_1
      CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB
      PARTITION BY KEY (a) PARTITIONS 2;
      INSERT INTO t1 VALUES (1,1);
      INSERT INTO t1 VALUES (2,2), (3,8);
      INSERT INTO t1 VALUES (4,16);
      --save_master_pos
       
      --connection server_2
      --sync_with_master
      SELECT * FROM t1 ORDER BY a;
       
      --connection server_1
      SHOW BINLOG EVENTS;
       
      --connection server_2
      --source include/stop_slave.inc
      SET GLOBAL slave_parallel_threads=@old_parallel_threads;
      --source include/start_slave.inc
       
      --connection server_1
      DROP TABLE t1;
       
      --source include/rpl_end.inc

      Output:

      include/rpl_init.inc [topology=1->2]
      SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
      include/stop_slave.inc
      SET GLOBAL slave_parallel_threads=10;
      include/start_slave.inc
      CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB
      PARTITION BY KEY (a) PARTITIONS 2;
      INSERT INTO t1 VALUES (1,1);
      INSERT INTO t1 VALUES (2,2), (3,8);
      INSERT INTO t1 VALUES (4,16);
      SELECT * FROM t1 ORDER BY a;
      a b
      1 1
      2 2
      3 8
      4 16
      SHOW BINLOG EVENTS;
      Log_name Pos Event_type Server_id End_log_pos Info
      master-bin.000001 4 Format_desc 1 248 Server ver: 10.0.11-MariaDB-debug-log, Binlog ver: 4
      master-bin.000001 248 Gtid_list 1 273 []
      master-bin.000001 273 Binlog_checkpoint 1 313 master-bin.000001
      master-bin.000001 313 Gtid 1 351 GTID 0-1-1
      master-bin.000001 351 Query 1 504 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB
      PARTITION BY KEY (a) PARTITIONS 2
      master-bin.000001 504 Gtid 1 542 BEGIN GTID 0-1-2
      master-bin.000001 542 Query 1 632 use `test`; INSERT INTO t1 VALUES (1,1)
      master-bin.000001 632 Xid 1 659 COMMIT /* xid=108 */
      master-bin.000001 659 Gtid 1 697 BEGIN GTID 0-1-3
      master-bin.000001 697 Query 1 794 use `test`; INSERT INTO t1 VALUES (2,2), (3,8)
      master-bin.000001 794 Xid 1 821 COMMIT /* xid=109 */
      master-bin.000001 821 Gtid 1 859 BEGIN GTID 0-1-4
      master-bin.000001 859 Query 1 950 use `test`; INSERT INTO t1 VALUES (4,16)
      master-bin.000001 950 Query 1 1019 COMMIT
      include/stop_slave.inc
      SET GLOBAL slave_parallel_threads=@old_parallel_threads;
      include/start_slave.inc
      DROP TABLE t1;
      include/rpl_end.inc
      rpl.rpl_mdev6020 'innodb_plugin,mix' [ pass ] 1782

      Attachments

        Issue Links

          Activity

            People

              knielsen Kristian Nielsen
              knielsen Kristian Nielsen
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

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