Skip to content

Commit

Permalink
MDEV-19803 Long semaphore wait error on galera.MW-388
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sciascid authored and Jan Lindström committed Jan 14, 2020
1 parent 56529a7 commit 7d31321
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
1 change: 0 additions & 1 deletion mysql-test/suite/galera/disabled.def
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

MW-286 : MDEV-18464 Killing thread can cause mutex deadlock if done concurrently with Galera/replication victim kill
MW-329 : MDEV-19962 Galera test failure on MW-329
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
Expand Down
4 changes: 1 addition & 3 deletions mysql-test/suite/galera/r/MW-388.result
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,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_replication SIGNAL wsrep_after_replication_reached WAIT_FOR wsrep_after_replication_continue';
CALL insert_proc ();;
connection node_1a;
SET SESSION DEBUG_SYNC = "now WAIT_FOR wsrep_after_replication_reached";
SET SESSION wsrep_sync_wait = 0;
SET GLOBAL debug_dbug = "";
SET DEBUG_SYNC = "now SIGNAL wsrep_after_replication_continue";
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
connection node_2;
connection node_1;
Expand Down
1 change: 0 additions & 1 deletion mysql-test/suite/galera/r/galera_ist_restart_joiner.result
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Loading wsrep_provider ...
SET SESSION wsrep_on=OFF;
SET SESSION wsrep_on=ON;
connection node_1;
connection node_1;
UPDATE t1 SET f2 = 'd' WHERE f1 > 3;
connection node_2;
connection node_1;
Expand Down
8 changes: 5 additions & 3 deletions mysql-test/suite/galera/t/MW-388.test
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,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');

Expand All @@ -40,14 +42,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_replication SIGNAL wsrep_after_replication_reached WAIT_FOR wsrep_after_replication_continue';
--send CALL insert_proc ();

--connection node_1a
SET SESSION DEBUG_SYNC = "now WAIT_FOR wsrep_after_replication_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_replication_continue";
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";

--connection node_2
Expand Down

0 comments on commit 7d31321

Please sign in to comment.