[MDEV-31906] Processlist shows stage and max stage 0 during online alter Created: 2023-08-12  Updated: 2023-08-12

Status: Open
Project: MariaDB Server
Component/s: Data Definition - Alter Table
Affects Version/s: 11.2
Fix Version/s: 11.2

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Nikita Malyavin
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Problem/Incident
is caused by MDEV-16329 Engine-independent online ALTER TABLE Closed
is caused by MDEV-28808 Test MDEV-16329 (ALTER ONLINE TABLE) ... Stalled

 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
...


Generated at Thu Feb 08 10:27:21 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.