From 45dd45fd3698f125a7ba67508ebe7afd63a6f4e5 Mon Sep 17 00:00:00 2001 From: Daniele Sciascia Date: Fri, 10 Jan 2020 11:55:30 +0100 Subject: MDEV-19803 Long semaphore wait error on galera.MW-388 The long semaphore wait appeared to be the caused by the following pattern in the MTR test: ``` SET DEBUG_SYNC = "now SIGNAL wsrep_after_certification_continue"; SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb; ``` Raising two signals, one right after another, caused one signal to overwrite the other, before the signal was consumed by the thread. This caused one thread to be stuck until the debug sync point would timeout. --- mysql-test/suite/galera/disabled.def | 1 - mysql-test/suite/galera/r/MW-388.result | 4 +--- mysql-test/suite/galera/t/MW-388.test | 9 +++++---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def index f888cb9d789..7b709ac8c80 100644 --- a/mysql-test/suite/galera/disabled.def +++ b/mysql-test/suite/galera/disabled.def @@ -15,7 +15,6 @@ MW-286 : MDEV-18464 Killing thread can cause mutex deadlock if done concurrently MW-329 : MDEV-19962 Galera test failure on MW-329 MW-336 : MDEV-21409: Galera test failure on MW-336 MW-360 : needs rewrite to be MariaDB gtid compatible -MW-388: MDEV-19803 Long semaphore wait error on galera.MW-388 galera_account_management : MariaDB 10.0 does not support ALTER USER galera_as_master_gtid : Requires MySQL GTID galera_as_master_gtid_change_master : Requires MySQL GTID diff --git a/mysql-test/suite/galera/r/MW-388.result b/mysql-test/suite/galera/r/MW-388.result index ab78b989efe..a8342463da9 100644 --- a/mysql-test/suite/galera/r/MW-388.result +++ b/mysql-test/suite/galera/r/MW-388.result @@ -20,12 +20,10 @@ connection node_1a; SET SESSION DEBUG_SYNC = "now WAIT_FOR sync.wsrep_apply_cb_reached"; connection node_1; SET SESSION wsrep_sync_wait = 0; -SET SESSION DEBUG_SYNC = 'wsrep_after_certification SIGNAL wsrep_after_certification_reached WAIT_FOR wsrep_after_certification_continue'; CALL insert_proc ();; connection node_1a; -SET SESSION DEBUG_SYNC = "now WAIT_FOR wsrep_after_certification_reached"; +SET SESSION wsrep_sync_wait = 0; SET GLOBAL DEBUG_DBUG = ""; -SET DEBUG_SYNC = "now SIGNAL wsrep_after_certification_continue"; SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb"; connection node_2; connection node_1; diff --git a/mysql-test/suite/galera/t/MW-388.test b/mysql-test/suite/galera/t/MW-388.test index e99559400c1..bcd5e27e427 100644 --- a/mysql-test/suite/galera/t/MW-388.test +++ b/mysql-test/suite/galera/t/MW-388.test @@ -30,6 +30,8 @@ DELIMITER ;| SET GLOBAL wsrep_slave_threads = 2; SET GLOBAL DEBUG_DBUG = "d,sync.wsrep_apply_cb"; +--let $expected_cert_failures = `SELECT VARIABLE_VALUE + 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_cert_failures'` + --connection node_2 --send INSERT INTO t1 VALUES (1, 'node 2'); @@ -39,15 +41,14 @@ SET SESSION DEBUG_SYNC = "now WAIT_FOR sync.wsrep_apply_cb_reached"; --connection node_1 SET SESSION wsrep_sync_wait = 0; -SET SESSION DEBUG_SYNC = 'wsrep_after_certification SIGNAL wsrep_after_certification_reached WAIT_FOR wsrep_after_certification_continue'; --send CALL insert_proc (); --connection node_1a -SET SESSION DEBUG_SYNC = "now WAIT_FOR wsrep_after_certification_reached"; - +SET SESSION wsrep_sync_wait = 0; +--let $wait_condition = SELECT VARIABLE_VALUE = $expected_cert_failures FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_cert_failures' +--source include/wait_condition.inc SET GLOBAL DEBUG_DBUG = ""; -SET DEBUG_SYNC = "now SIGNAL wsrep_after_certification_continue"; SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb"; --connection node_2 -- cgit v1.2.1