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

Replica's DML event deadlocks with online alter table

    XMLWordPrintable

Details

    Description

      A deadlock of two phase binlogged "start" ALTER with the following in binlog order DML statement on the parallel slave is caused
      by partly missed integration of a MDEV-16329's feature with the MDEV-11675 framework. A stronger than required MDL lock
      by ALTER prevents the DML execution on slave (while it succeed on master).
      The following mtr test exposes it

      source include/master-slave.inc;
       
      --connection slave
      source include/stop_slave.inc;
       
      #
      # MDEV-31755 Replica's DML event deadlocks wit online alter table
      #
      # Three threads for SA,U,CA
      --let $slave_parallel_threads=`select @@global.slave_parallel_threads`
      --let $slave_parallel_mode=   `select @@global.slave_parallel_mode`
      set global slave_parallel_threads=3;
      set global slave_parallel_mode= optimistic;
       
      --connection master
      create table t (id int, a int, b text, primary key (id));
      insert into t values (1,10,''),(2,20,'');
       
      set @@session.binlog_alter_two_phase=1;
      set debug_sync= 'alter_table_online_progress signal ready wait_for go';
      send alter table t force, algorithm=copy, lock=none;
       
      connect (con1,localhost,root,,);
      set debug_sync= 'now wait_for ready';
       
      update t set a = 1;
       
      set debug_sync= 'now signal go';
       
      --connection master
      --reap
      --source include/save_master_gtid.inc
       
      --connection slave
      source include/start_slave.inc;
      --source include/sync_with_master_gtid.inc
      

      Attachments

        1. slave_status
          2 kB
          Elena Stepanova
        2. status
          65 kB
          Elena Stepanova
        3. threads_slave
          58 kB
          Elena Stepanova
        4. threads_slave_full
          161 kB
          Elena Stepanova
        5. variables
          85 kB
          Elena Stepanova

        Issue Links

          Activity

            People

              nikitamalyavin Nikita Malyavin
              nikitamalyavin Nikita Malyavin
              Votes:
              0 Vote for this issue
              Watchers:
              5 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.