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

Row-based triggers: Assertion `i == tables_to_lock_count' fails with a trigger on row-based event while slave operates in SBR

    XMLWordPrintable

Details

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

    Description

      In the test case below, the slave has binlog_format STATEMENT, while master writes events in row format. Normally, the replication should abort on executing a row event, complaining that it cannot be written to the slave's binlog. With RBR triggers, we are getting an assertion failure instead.

      sql/rpl_rli.cc:1280: void Relay_log_info::clear_tables_to_lock(): Assertion `i == tables_to_lock_count' failed.
      131122 22:37:31 [ERROR] mysqld got signal 6 ;

      #6  0x00007f1a0da3d621 in *__GI___assert_fail (assertion=0xd9a817 "i == tables_to_lock_count", file=<optimized out>, line=1280, function=0xd9af60 "void Relay_log_info::clear_tables_to_lock()") at assert.c:81
      #7  0x000000000072259a in Relay_log_info::clear_tables_to_lock (this=0x7f1a097477f0) at /home/elenst/bzr/5.5-sanja-MDEV-5095/sql/rpl_rli.cc:1280
      #8  0x000000000072278e in Relay_log_info::slave_close_thread_tables (this=0x7f1a097477f0, thd=0x7f1a00209060) at /home/elenst/bzr/5.5-sanja-MDEV-5095/sql/rpl_rli.cc:1333
      #9  0x00000000008ca1cc in Rows_log_event::do_apply_event (this=0x7f1a0d05efa0, rli=0x7f1a097477f0) at /home/elenst/bzr/5.5-sanja-MDEV-5095/sql/log_event.cc:8375
      #10 0x00000000005ad382 in Log_event::apply_event (this=0x7f1a0d05efa0, rli=0x7f1a097477f0) at /home/elenst/bzr/5.5-sanja-MDEV-5095/sql/log_event.h:1256
      #11 0x00000000005a5103 in apply_event_and_update_pos (ev=0x7f1a0d05efa0, thd=0x7f1a00209060, rli=0x7f1a097477f0) at /home/elenst/bzr/5.5-sanja-MDEV-5095/sql/slave.cc:2631
      #12 0x00000000005a5698 in exec_relay_log_event (thd=0x7f1a00209060, rli=0x7f1a097477f0) at /home/elenst/bzr/5.5-sanja-MDEV-5095/sql/slave.cc:2791
      #13 0x00000000005a7ae6 in handle_slave_sql (arg=0x7f1a09746000) at /home/elenst/bzr/5.5-sanja-MDEV-5095/sql/slave.cc:3648
      #14 0x0000000000973c35 in pfs_spawn_thread (arg=0x7f19fe15aac0) at /home/elenst/bzr/5.5-sanja-MDEV-5095/storage/perfschema/pfs.cc:1015
      #15 0x00007f1a0ef9db50 in start_thread (arg=<optimized out>) at pthread_create.c:304
      #16 0x00007f1a0daeca7d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112

      revision-id: sanja@askmonty.org-20131122113905-6k8j5ba9e3drn52t
      revno: 3944
      branch-nick: 5.5-sanja-MDEV-5095
      BUILD/compile-pentium-debug-max-no-ndb

      --source include/master-slave.inc
      --source include/have_binlog_format_statement.inc
       
      set binlog_format = row;
       
      create table t1 (i int);
      create table t2 (i int);
       
      --sync_slave_with_master
       
      set global slave_run_triggers_for_rbr=YES;
       
      create trigger tr_before before insert on t1 for each row
        insert into t2 values (1);
       
      --connection master
       
      insert into t1 values (1);
       
      --sync_slave_with_master

      Attachments

        Issue Links

          Activity

            People

              sanja Oleksandr Byelkin
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.