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

Processlist shows stage and max stage 0 during online alter

    XMLWordPrintable

Details

    Description

      The reproducer may be non-deterministic, despite the debug sync point. On my machine the result depends on the number of rows in the table, below some row count the stages are shown as 3/4. I don't know whether it's related to the number of binlog events, or to their total size, or it is just a race condition of some sort. In the latter case you may be getting a different result on your machine/build, try to change (especially increase) the number of rows in the table.

      Please don't put this test case into the regression suite, create a deterministic one instead.

      --source include/have_innodb.inc
      --source include/have_debug_sync.inc
      --source include/have_sequence.inc
       
      create table t (pk int, a int) engine=InnoDB;
      insert into t select seq, seq from seq_1_to_5000;
       
      --send set debug_sync= 'now wait_for go_dml'
       
      --connect (con1,localhost,root,,)
      set debug_sync= 'alter_table_online_before_lock signal go_dml wait_for go_alter';
      --send alter table t force, algorithm=copy, lock=none;
       
      --connection default
      --reap
      update t set a = a + 1;
      set debug_sync= 'now signal go_alter';
       
      --let $run=100
      while ($run)
      {
        query_vertical select stage, max_stage, info, state from information_schema.processlist where info like 'alter%';
        --sleep 1
        --dec $run
        if (`select count(*) = 0 from information_schema.processlist where info like 'alter%'`)
        {
          --let $run= 0
        }
      }
       
       
      --connection con1
      --reap
      drop table t;
      set debug_sync= reset;
      

      bb-11.2-oalter c29ff60b2c8

      connection default;
      update t set a = a + 1;
      set debug_sync= 'now signal go_alter';
      select stage, max_stage, info, state from information_schema.processlist where info like 'alter%';
      stage	0
      max_stage	0
      info	alter table t force, algorithm=copy, lock=none
      state	Update_rows_log_event::ha_update_row(-1) on table `t`
      select stage, max_stage, info, state from information_schema.processlist where info like 'alter%';
      stage	0
      max_stage	0
      info	alter table t force, algorithm=copy, lock=none
      state	Update_rows_log_event::find_row(-1) on table `t`
      select stage, max_stage, info, state from information_schema.processlist where info like 'alter%';
      stage	0
      max_stage	0
      ...
      

      Attachments

        Issue Links

          Activity

            People

              nikitamalyavin Nikita Malyavin
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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