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

Partitioned table DML sometimes binlogged without XID event

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      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
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              knielsen Kristian Nielsen added a comment -

              Reverting this patch fixes the problem (thanks to Serg for that find):

              revno: 2502.163.19
              revision-id: monty@askmonty.org-20100325133339-7mkel6valai0b4lb
              parent: sergii@pisem.net-20100323092233-t2gwaclx94hd6exa
              committer: Michael Widenius <monty@askmonty.org>
              branch nick: maria-5.2
              timestamp: Thu 2010-03-25 15:33:39 +0200
              message:
              simple speed & space optimization:

              • Avoid full inline of mark_trx_read_write() for many functions
              • Avoid somewhat expensive tests for every write/update/delete row
              Show
              knielsen Kristian Nielsen added a comment - Reverting this patch fixes the problem (thanks to Serg for that find): revno: 2502.163.19 revision-id: monty@askmonty.org-20100325133339-7mkel6valai0b4lb parent: sergii@pisem.net-20100323092233-t2gwaclx94hd6exa committer: Michael Widenius <monty@askmonty.org> branch nick: maria-5.2 timestamp: Thu 2010-03-25 15:33:39 +0200 message: simple speed & space optimization: Avoid full inline of mark_trx_read_write() for many functions Avoid somewhat expensive tests for every write/update/delete row
              Hide
              knielsen Kristian Nielsen added a comment -

              Pushed to 5.2, merged to 5.3 and 5.5. Will be later merged to 10.0

              Show
              knielsen Kristian Nielsen added a comment - Pushed to 5.2, merged to 5.3 and 5.5. Will be later merged to 10.0

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved: