Skip to content

Commit 25a67c6

Browse files
committed
Bug #28971954 MOVE GCS_XCOM_CONTROL_INTERFACE-T.CC TO THE UNIT TESTS DIRECTORY
Problem and analysis ======================================================================== The gcs_xcom_control_interface-t.cc test file is in the smoke tests' directory but it should be in the unit tests'. The file's tests take around ~300 seconds, which is too much. The reason is that we wait for the suspicions processing thread to wake up on its own, and terminate, when we we leave the group. Solution ======================================================================== Proactively wake up the suspicions processing thread when we leave the group, instead of waiting for the thread to wake up on its own. This cuts down the duration of several tests substantially. Move the gcs_xcom_control_interface-t.cc file to the unit tests' directory and merge it with the recently created gcs_xcom_control_interface_unit-t.cc. Suppress a message about misconfigured local_address on gr_autorejoin_stop_gr. This message is expected because the test misconfigures local_address to trigger the rejoin procedure. The hypothesis is that the message did not appear before due to the artificial delay in the leave operation. (Waiting for the suspicions processing thread to wake up.) Suppress a message about view change timeout on gr_recovery_no_donors. This message appears because there is a circular dependency between the delivery of view change notifications and an ongoing recovery procedure. Specifically, the view change notifications are only sent after the recovery procedure terminates, but the recovery procedure only terminates after receiving the view change notification: both wait for each other until they time out. The message did not appear before due to the artificial delay in the leave operation. (Waiting for the suspicions processing thread to wake up.) The recovery procedure would finish before the view change, whereas now the view change is delivered while the recovery procedur is ongoing. A bug report was opened to deal with this situation, whose patch should remove the suppressions. Reviewed-by: Andre Negrao <andre.negrao@oracle.com> Reviewed-by: Tiago Jorge <tiago.jorge@oracle.com> RB: 21373
1 parent a98717c commit 25a67c6

File tree

5 files changed

+2215
-1
lines changed

5 files changed

+2215
-1
lines changed

mysql-test/suite/group_replication/t/gr_autorejoin_stop_gr.test

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ call mtr.add_suppression("\\[GCS\\] The member has left the group but the new vi
4242
call mtr.add_suppression("\\[GCS\\] read failed");
4343
call mtr.add_suppression("Started auto-rejoin procedure attempt*");
4444
call mtr.add_suppression("Auto-rejoin procedure attempt*");
45+
--disable_query_log # No need for the result file to specify suppressions.
46+
call mtr.add_suppression("\\[GCS\\] There is no local IP address matching the one configured for the local node .*");
47+
call mtr.add_suppression("Unable to initialize the group communication engine");
48+
--enable_query_log
4549
SET sql_log_bin = 1;
4650

4751
--source include/gr_autorejoin_monitoring.inc

mysql-test/suite/group_replication/t/gr_recovery_no_donors.test

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ call mtr.add_suppression("Skipping leave operation: concurrent attempt to leave
4040
call mtr.add_suppression("Maximum number of retries when trying to connect to a donor reached. Aborting group replication recovery.");
4141
call mtr.add_suppression("Transaction cannot be executed while Group Replication is stopping.");
4242
call mtr.add_suppression("Run function 'before_commit' in plugin 'group_replication' failed");
43+
--disable_query_log # No need for the result file to specify suppressions.
44+
call mtr.add_suppression("While leaving the group due to a stop, shutdown or failure there was a timeout receiving a view change. This can lead to a possible inconsistent state. Check the log for more details");
45+
--enable_query_log
4346
SET SESSION sql_log_bin= 1;
4447

4548
CREATE TABLE t1 (a INT PRIMARY KEY AUTO_INCREMENT NOT NULL);
@@ -97,6 +100,9 @@ call mtr.add_suppression("All donors left. Aborting group replication recovery."
97100
call mtr.add_suppression("The member is already leaving or joining a group.");
98101
call mtr.add_suppression("Skipping leave operation: member already left the group.");
99102
call mtr.add_suppression("Skipping leave operation: concurrent attempt to leave the group is on-going.");
103+
--disable_query_log # No need for the result file to specify suppressions.
104+
call mtr.add_suppression("While leaving the group due to a stop, shutdown or failure there was a timeout receiving a view change. This can lead to a possible inconsistent state. Check the log for more details");
105+
--enable_query_log
100106
SET SESSION sql_log_bin= 1;
101107

102108

plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_xcom_control_interface.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ enum_gcs_error Gcs_xcom_control::do_leave() {
686686

687687
assert(m_xcom_proxy->xcom_is_exit());
688688

689-
set_terminate_suspicion_thread(true);
689+
m_suspicions_manager->wake_suspicions_processing_thread(true);
690690

691691
m_suspicions_processing_thread.join(NULL);
692692
MYSQL_GCS_LOG_TRACE("The suspicions processing thread has joined.");

unittest/gunit/libmysqlgcs/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ SET(GCS_XCOM_TESTS
8686
xcom/gcs_xcom_xcom_transport
8787
xcom/gcs_xcom_communication_protocol_changer
8888
xcom/gcs_xcom_xcom_cache
89+
xcom/gcs_xcom_control_interface
8990
)
9091

9192
###

0 commit comments

Comments
 (0)