diff --git a/mysql-test/suite/galera_3nodes_sr/r/GCF-336.result b/mysql-test/suite/galera_3nodes_sr/r/GCF-336.result index eeccfa3b5a3..8fc853f8425 100644 --- a/mysql-test/suite/galera_3nodes_sr/r/GCF-336.result +++ b/mysql-test/suite/galera_3nodes_sr/r/GCF-336.result @@ -25,6 +25,8 @@ SET SESSION wsrep_sync_wait=0; connection node_2; INSERT INTO t1 VALUES (2); ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +connection node_2a; +connection node_2; COMMIT; ERROR 08S01: WSREP has not yet prepared node for application use connection node_2a; diff --git a/mysql-test/suite/galera_3nodes_sr/t/GCF-336.test b/mysql-test/suite/galera_3nodes_sr/t/GCF-336.test index ba85aa5291c..20d5955e4fc 100644 --- a/mysql-test/suite/galera_3nodes_sr/t/GCF-336.test +++ b/mysql-test/suite/galera_3nodes_sr/t/GCF-336.test @@ -27,6 +27,12 @@ SET SESSION wsrep_sync_wait=0; --connection node_2 --error ER_LOCK_DEADLOCK INSERT INTO t1 VALUES (2); + +--connection node_2a +--let $wait_condition = SELECT VARIABLE_VALUE = 'non-Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; +--source include/wait_condition.inc + +--connection node_2 --error ER_UNKNOWN_COM_ERROR COMMIT; diff --git a/sql/slave.cc b/sql/slave.cc index 66b42cabcd4..6032256c60c 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -3895,7 +3895,7 @@ apply_event_and_update_pos_apply(Log_event* ev, THD* thd, rpl_group_info *rgi, if (thd->system_thread == SYSTEM_THREAD_SLAVE_SQL && ((rli->mi->using_parallel() && rli->mi->parallel_mode <= SLAVE_PARALLEL_CONSERVATIVE) || - wsrep_ready == 0)) { + !wsrep_ready_get())) { rli->abort_slave= 1; rli->report(ERROR_LEVEL, ER_UNKNOWN_COM_ERROR, rgi->gtid_info(), "Node has dropped from cluster"); diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc index 8bd953e98b2..e584c2cc144 100644 --- a/sql/wsrep_mysqld.cc +++ b/sql/wsrep_mysqld.cc @@ -3456,7 +3456,7 @@ void wsrep_ready_set(bool ready_value) mysql_mutex_lock(&LOCK_wsrep_ready); wsrep_ready= ready_value; // Signal if we have reached ready state - if (wsrep_ready) + if (ready_value) mysql_cond_signal(&COND_wsrep_ready); mysql_mutex_unlock(&LOCK_wsrep_ready); } diff --git a/sql/wsrep_notify.cc b/sql/wsrep_notify.cc index 1c8b2b47bfe..bd2919a223e 100644 --- a/sql/wsrep_notify.cc +++ b/sql/wsrep_notify.cc @@ -24,7 +24,7 @@ void wsrep_notify_status(enum wsrep::server_state::state status, if (!view) { WSREP_DEBUG("wsrep_notify_status server not yet ready : wsrep_ready=%d status %d", - wsrep_ready, (int)status); + (int) wsrep_ready_get(), (int)status); return; } diff --git a/sql/wsrep_server_service.cc b/sql/wsrep_server_service.cc index e6cfb7948b9..af2c3efd214 100644 --- a/sql/wsrep_server_service.cc +++ b/sql/wsrep_server_service.cc @@ -340,7 +340,6 @@ void Wsrep_server_service::log_state_change( switch (current_state) { case Wsrep_server_state::s_synced: - wsrep_ready= TRUE; WSREP_INFO("Synchronized with group, ready for connections"); wsrep_ready_set(true); /* fall through */