From cb5dd76959859e465828672dedff6c7ee0811a06 Mon Sep 17 00:00:00 2001 From: Brandon Nesterenko Date: Sat, 25 Jan 2025 09:58:56 -0700 Subject: [PATCH] MDEV-35938: rpl.rpl_parallel_gco_wait_kill fails - "Can't initialize replace ..." Test rpl.rpl_parallel_gco_wait_kill has a race condition where it identifies that SQL using its state as "Slave has read all relay log", and immediately tries to save the thread id of the SQL thread by querying for threads with that same state. However, the state of the SQL thread may change in-between this time, leading to the query that saves the SQL thread finding no thread id that matches that state. Commit 3ee6f69d49a58422f994f51a0bd7a0cb1242a3dd aimed to fix this in 10.11+ by simplifying the query string to "%relay log%"; however, it could still fail (though less often). This commit instead changes the query to find the SQL thread from using some state, to using the command "Slave_SQL", which will not change --- mysql-test/suite/rpl/t/rpl_parallel_gco_wait_kill.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/suite/rpl/t/rpl_parallel_gco_wait_kill.test b/mysql-test/suite/rpl/t/rpl_parallel_gco_wait_kill.test index d918b2ea692..f4d9777f75e 100644 --- a/mysql-test/suite/rpl/t/rpl_parallel_gco_wait_kill.test +++ b/mysql-test/suite/rpl/t/rpl_parallel_gco_wait_kill.test @@ -297,7 +297,7 @@ SET GLOBAL slave_parallel_threads=10; # Find the thread id of the driver SQL thread that we want to kill. --let $wait_condition= SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%Slave has read all relay log%' --source include/wait_condition.inc ---let $thd_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%Slave has read all relay log%'` +--let $thd_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE COMMAND LIKE 'Slave_SQL'` SET @old_max_queued= @@GLOBAL.slave_parallel_max_queued; SET GLOBAL slave_parallel_max_queued=9000;