From 632a503ce7726547d8d858ae89fc3833ff95fe83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Wed, 23 Aug 2023 11:27:13 +0300 Subject: [PATCH] MDEV-29861 : Galera "notify" test cases hang Problem was that if wsrep_notify_cmd was set it was called with a new status "joined" it tries to connect to the server to update some table, but the server isn't initialized yet, it's not listening for connections. So the server waits for the script to finish, script waits for mariadb client to connect, and the client cannot connect, because the server isn't listening. Fix is to call script only when Galera has already formed a view or when it is synched or donor. This fix also enables following test cases: * galera.MW-284 * galera.galera_binlog_checksum * galera_var_notify_ssl_ipv6 Signed-off-by: Julius Goryavsky --- mysql-test/suite/galera/disabled.def | 4 ---- sql/wsrep_notify.cc | 7 +++++++ sql/wsrep_utils.h | 6 +++++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def index 7bd12ba7514..b70ab461aaa 100644 --- a/mysql-test/suite/galera/disabled.def +++ b/mysql-test/suite/galera/disabled.def @@ -13,10 +13,6 @@ galera_as_slave_ctas : MDEV-28378 timeout galera_pc_recovery : MDEV-25199 cluster fails to start up galera_sst_encrypted : MDEV-29876 Galera test failure on galera_sst_encrypted -galera.MW-284 : MDEV-29861 Galera test case hangs -galera.galera_binlog_checksum : MDEV-29861 Galera test case hangs -galera_var_notify_ssl_ipv6 : MDEV-29861 Galera test case hangs -galera_var_notify_cmd: MDEV-29861 Galera test case hangs galera_var_node_address : MDEV-20485 Galera test failure MDEV-26575 : MDEV-29878 Galera test failure on MDEV-26575 galera_bf_abort_group_commit : MDEV-30855 PR to remove the test exists diff --git a/sql/wsrep_notify.cc b/sql/wsrep_notify.cc index d2d08e92ae7..b4e4de1ef0d 100644 --- a/sql/wsrep_notify.cc +++ b/sql/wsrep_notify.cc @@ -21,6 +21,13 @@ void wsrep_notify_status(enum wsrep::server_state::state status, const wsrep::view* view) { + if (!view) + { + WSREP_DEBUG("wsrep_notify_status server not yet ready : wsrep_ready=%d status %d", + wsrep_ready, (int)status); + return; + } + if (!wsrep_notify_cmd || 0 == strlen(wsrep_notify_cmd)) { WSREP_INFO("wsrep_notify_cmd is not defined, skipping notification."); diff --git a/sql/wsrep_utils.h b/sql/wsrep_utils.h index 743e8d1fb70..d34b15e3b09 100644 --- a/sql/wsrep_utils.h +++ b/sql/wsrep_utils.h @@ -189,7 +189,11 @@ public: void set(enum wsrep::server_state::state status) { - wsrep_notify_status(status); + if (status == wsrep::server_state::s_donor || + status == wsrep::server_state::s_synced) + wsrep_notify_status(status, &view_); + else + wsrep_notify_status(status); lock(); status_= status;