Skip to content

Commit 46e9bcf

Browse files
committed
WL#15713: GR default change: set group_replication_exit_state_action=OFFLINE_MODE
Change the default of group_replication_exit_state_action from READ_ONLY to OFFLINE_MODE. Change-Id: I89723ce8e9cb1ada406acd28410d9d2f6c31eff3
1 parent 2f0c291 commit 46e9bcf

File tree

224 files changed

+377
-35
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

224 files changed

+377
-35
lines changed

mysql-test/include/stop_group_replication.inc

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
# --let $group_replication_group_name= UUID
1010
# [--let $skip_assert_read_only= 1]
1111
# [--let $skip_reset_read_mode= 1]
12+
# [--let $skip_assert_offline_mode= 1]
13+
# [--let $skip_reset_offline_mode= 1]
1214
# [--let $$wait_timeout= NUMBER]
1315
# [--let $rpl_debug= 1]
1416
# --source include/stop_group_replication.inc
@@ -25,6 +27,13 @@
2527
# Skip the disabling of read_only vars
2628
# See include/assert_and_disable_read_only.inc
2729
#
30+
# $skip_assert_offline_mode
31+
# Skip assert that offline_mode is enabled when the member is in ERROR state,
32+
# and the consequent disable of both variables
33+
#
34+
# $skip_reset_offline_mode
35+
# Skip reset offline_mode variable.
36+
#
2837
# $wait_timeout
2938
# See include/wait_condition.inc
3039
#
@@ -44,6 +53,21 @@ if (!$rpl_debug)
4453
--disable_query_log
4554
}
4655

56+
--let $_is_member_in_error_state=
57+
--let $_is_member_auto_rejoin_running= 0
58+
if (!$skip_assert_offline_mode)
59+
{
60+
# Save member state before it changes to OFFLINE.
61+
--let $_this_member_id= query_get_value(SELECT @@SERVER_UUID, @@SERVER_UUID, 1)
62+
--let $_is_member_in_error_state= `SELECT member_state IN ("ERROR") FROM performance_schema.replication_group_members WHERE member_id="$_this_member_id"`
63+
64+
if ($_is_member_in_error_state)
65+
{
66+
# Check if auto-rejoin is running before STOP.
67+
--let $_is_member_auto_rejoin_running= `SELECT COUNT(*) FROM performance_schema.events_stages_current WHERE EVENT_NAME LIKE '%auto-rejoin%'`
68+
}
69+
}
70+
4771
STOP GROUP_REPLICATION;
4872

4973
--let $wait_condition= SELECT COUNT(*)=1 FROM performance_schema.replication_connection_status connection_status WHERE connection_status.channel_name="group_replication_applier" AND connection_status.service_state="OFF"
@@ -70,5 +94,21 @@ if (!$skip_assert_read_only)
7094
}
7195
--let $skip_assert_read_only=
7296

97+
if (!$skip_assert_offline_mode)
98+
{
99+
if ($_is_member_in_error_state)
100+
{
101+
if ($_is_member_auto_rejoin_running == 0)
102+
{
103+
--let $_member_exit_state_action= `SELECT @@GLOBAL.group_replication_exit_state_action`
104+
if ($_member_exit_state_action == "OFFLINE_MODE")
105+
{
106+
--source include/assert_and_disable_offline_mode.inc
107+
}
108+
}
109+
}
110+
}
111+
--let $skip_assert_offline_mode=
112+
73113
--let $include_filename= stop_group_replication.inc
74114
--source include/end_include_file.inc

mysql-test/suite/group_replication/include/gr_exit_state_action_on_member_expel.inc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ DROP TABLE pid_table;
4646
# Supress log errors since they are expected.
4747
call mtr.add_suppression("Member was expelled from the group due to network failures, changing member status to ERROR.");
4848
call mtr.add_suppression("The server was automatically set into read only mode after an error was detected.");
49+
call mtr.add_suppression("The server was automatically set into offline mode after an error was detected.");
4950
call mtr.add_suppression("Skipping leave operation: concurrent attempt to leave the group is on-going.");
5051
call mtr.add_suppression("The plugin encountered a critical error and will abort: Member was expelled from the group due to network failures.");
5152
call mtr.add_suppression("Error, maximum number of retries exceeded when waiting for the internal server session state to be operating");
@@ -59,6 +60,8 @@ SET SESSION sql_log_bin = 1;
5960
--let $local_address_server1= `SELECT @@GLOBAL.group_replication_local_address`
6061
--let $group_seeds_server1= `SELECT @@GLOBAL.group_replication_group_seeds`
6162

63+
# Set the exit state action sysvar to READ_ONLY
64+
SET @@GLOBAL.group_replication_exit_state_action = READ_ONLY;
6265

6366
--echo
6467
--echo #########################################################################

mysql-test/suite/group_replication/r/gr_abort_query_on_plugin_error.result

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ call mtr.add_suppression("The member is already leaving or joining a group.");
3838
call mtr.add_suppression("Error leaving the group");
3939
call mtr.add_suppression("Skipping leave operation: concurrent attempt to leave the group is on-going.");
4040
call mtr.add_suppression("The server was automatically set into read only mode after an error was detected.");
41+
call mtr.add_suppression("The server was automatically set into offline mode after an error was detected.");
4142
set session sql_log_bin=1;
4243
[connection server1]
4344
INSERT INTO test.t1 (b) VALUES (0);

mysql-test/suite/group_replication/r/gr_acf_error_state_handling.result

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ call mtr.add_suppression("Error at event handling! Got error: 1");
1414
call mtr.add_suppression("The member is leaving a group without being on one");
1515
call mtr.add_suppression("Due to a plugin error, some transactions were unable to be certified and will now rollback.");
1616
call mtr.add_suppression("The server was automatically set into read only mode after an error was detected.");
17+
call mtr.add_suppression("The server was automatically set into offline mode after an error was detected.");
1718
call mtr.add_suppression("Error while waiting for conflict detection procedure to finish on session .*");
1819
call mtr.add_suppression("Run function 'before_commit' in plugin 'group_replication' failed");
1920
call mtr.add_suppression("Skipping leave operation: concurrent attempt to leave the group is on-going.");
@@ -26,6 +27,7 @@ CALL mtr.add_suppression("Could not execute Write_rows event on table test.t1");
2627
CALL mtr.add_suppression("The applier thread execution was aborted. Unable to process more transactions, this member will now leave the group.");
2728
CALL mtr.add_suppression("Fatal error during execution on the Applier process of Group Replication. The server will now leave the group.");
2829
CALL mtr.add_suppression("The server was automatically set into read only mode after an error was detected.");
30+
CALL mtr.add_suppression("The server was automatically set into offline mode after an error was detected.");
2931
CALL mtr.add_suppression("Skipping leave operation: concurrent attempt to leave the group is on-going.");
3032
CALL mtr.add_suppression("The replica coordinator and worker threads are stopped");
3133
SET sql_log_bin=1;

mysql-test/suite/group_replication/r/gr_acf_receiver_failover_channel_non_existent_on_the_group.result

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ SET SESSION sql_log_bin= 0;
1414
call mtr.add_suppression("Unable to set SOURCE_CONNECTION_AUTO_FAILOVER on a non-existent or misconfigured replication channel 'ch1', please create the channel and rejoin the server to the group.");
1515
call mtr.add_suppression("A message sent through the Group Replication message deliver service was not delivered successfully. The server will now leave the group.*");
1616
call mtr.add_suppression("The server was automatically set into read only mode after an error was detected.");
17+
call mtr.add_suppression("The server was automatically set into offline mode after an error was detected.");
1718
call mtr.add_suppression("Skipping leave operation: concurrent attempt to leave the group is on-going.");
1819
SET SESSION sql_log_bin= 1;
1920
include/start_group_replication.inc

mysql-test/suite/group_replication/r/gr_acf_start_failover_channels_error_on_bootstrap.result

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Note 1760 Storing MySQL user name or password information in the connection meta
2727
SET SESSION sql_log_bin = 0;
2828
call mtr.add_suppression("The member action \"mysql_start_failover_channels_if_primary\" for event \"AFTER_PRIMARY_ELECTION\" with priority \"10\" failed. Please check previous messages in the error log for hints about what could have caused this failure.");
2929
call mtr.add_suppression("The server was automatically set into read only mode after an error was detected.");
30+
call mtr.add_suppression("The server was automatically set into offline mode after an error was detected.");
3031
call mtr.add_suppression("Skipping leave operation: concurrent attempt to leave the group is on-going.");
3132
call mtr.add_suppression("Error while sending message. Context: primary election process.");
3233
SET SESSION sql_log_bin = 1;

mysql-test/suite/group_replication/r/gr_applier_and_shutdown.result

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ call mtr.add_suppression("Skipping leave operation: concurrent attempt to leave
1414
call mtr.add_suppression("Fatal error during execution on the Applier process of Group Replication. The server will now leave the group.");
1515
call mtr.add_suppression("Skipping leave operation: member already left the group.");
1616
call mtr.add_suppression("The server was automatically set into read only mode after an error was detected.");
17+
call mtr.add_suppression("The server was automatically set into offline mode after an error was detected.");
1718
call mtr.add_suppression("Error, maximum number of retries exceeded when waiting for the internal server session state to be operating");
1819
call mtr.add_suppression("Failed to establish an internal server connection to execute plugin operations");
1920
SET SESSION sql_log_bin = 1;

mysql-test/suite/group_replication/r/gr_applier_early_failure.result

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ call mtr.add_suppression("Unable to initialize the Group Replication applier mod
5454
call mtr.add_suppression("The applier thread execution was aborted. Unable to process more transactions, this member will now leave the group.");
5555
call mtr.add_suppression("Fatal error during execution on the Applier process of Group Replication. The server will now leave the group.");
5656
call mtr.add_suppression("The server was automatically set into read only mode after an error was detected.");
57+
call mtr.add_suppression("The server was automatically set into offline mode after an error was detected.");
5758
call mtr.add_suppression("Unable to confirm whether the server has left the group or not. Check *.*");
5859
call mtr.add_suppression("Skipping leave operation: concurrent attempt to leave the group is on-going.");
5960
call mtr.add_suppression("Replica SQL for channel 'group_replication_applier': Could not execute Write_rows event on table");

mysql-test/suite/group_replication/r/gr_applier_error.result

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ CALL mtr.add_suppression("Could not execute Write_rows event on table test.t1");
2424
CALL mtr.add_suppression("The applier thread execution was aborted. Unable to process more transactions, this member will now leave the group.");
2525
CALL mtr.add_suppression("Fatal error during execution on the Applier process of Group Replication. The server will now leave the group.");
2626
CALL mtr.add_suppression("The server was automatically set into read only mode after an error was detected.");
27+
CALL mtr.add_suppression("The server was automatically set into offline mode after an error was detected.");
2728
CALL mtr.add_suppression("Skipping leave operation: concurrent attempt to leave the group is on-going.");
2829
CALL mtr.add_suppression("The replica coordinator and worker threads are stopped");
2930
SET sql_log_bin=1;

mysql-test/suite/group_replication/r/gr_applier_privileged_user.result

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ CALL mtr.add_suppression(".*Worker .* failed executing transaction .* INSERT com
1313
CALL mtr.add_suppression(".*Plugin group_replication reported: 'The applier thread execution was aborted. Unable to process more transactions, this member will now leave the group.'.*");
1414
CALL mtr.add_suppression(".*Plugin group_replication reported: 'Fatal error during execution on the Applier process of Group Replication. The server will now leave the group.'.*");
1515
CALL mtr.add_suppression(".*Plugin group_replication reported: 'The server was automatically set into read only mode after an error was detected.'.*");
16+
CALL mtr.add_suppression("The server was automatically set into offline mode after an error was detected.");
1617
CALL mtr.add_suppression(".*Plugin group_replication reported: 'Skipping leave operation: concurrent attempt to leave the group is on-going.'.*");
1718
CALL mtr.add_suppression(".*The replica coordinator and worker threads are stopped.*");
1819
SET @@sql_log_bin = 1;

mysql-test/suite/group_replication/r/gr_applier_thread_error_detection.result

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ call mtr.add_suppression("Replica SQL for channel 'group_replication_applier': .
1515
call mtr.add_suppression("Fatal error during execution on the Applier process of Group Replication. The server will now leave the group.");
1616
call mtr.add_suppression("The member is leaving a group without being on one");
1717
call mtr.add_suppression("The server was automatically set into read only mode after an error was detected.");
18+
call mtr.add_suppression("The server was automatically set into offline mode after an error was detected.");
1819
call mtr.add_suppression("The member is already leaving or joining a group.");
1920
call mtr.add_suppression("Error leaving the group");
2021
call mtr.add_suppression("Skipping leave operation: concurrent attempt to leave the group is on-going.");

mysql-test/suite/group_replication/r/gr_applier_thread_failure_detection.result

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ call mtr.add_suppression("Replica SQL for channel 'group_replication_applier': C
4343
call mtr.add_suppression("The applier thread execution was aborted. Unable to process more transactions, this member will now leave the group.");
4444
call mtr.add_suppression("Fatal error during execution on the Applier process of Group Replication. The server will now leave the group.");
4545
call mtr.add_suppression("The server was automatically set into read only mode after an error was detected.");
46+
call mtr.add_suppression("The server was automatically set into offline mode after an error was detected.");
4647
call mtr.add_suppression("Replica SQL for channel 'group_replication_applier': Worker .* failed executing transaction .*");
4748
call mtr.add_suppression("Replica SQL for channel 'group_replication_applier': ... The replica coordinator and worker threads are stopped,.*");
4849
SET SESSION sql_log_bin= 1;

mysql-test/suite/group_replication/r/gr_autorejoin_failure_during_mid_join.result

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ call mtr.add_suppression("Member was expelled from the group due to network fail
1010
call mtr.add_suppression("Started auto-rejoin procedure attempt*");
1111
call mtr.add_suppression("Auto-rejoin procedure attempt*");
1212
call mtr.add_suppression("The server was automatically set into read only mode after an error was detected.");
13+
call mtr.add_suppression("The server was automatically set into offline mode after an error was detected.");
1314
call mtr.add_suppression("Unable to confirm whether the server has left the group or not. Check performance_schema.replication_group_members to check group membership information.");
1415
call mtr.add_suppression("Timeout while waiting for a view change event during the leave step before a auto-rejoin attempt.");
1516
call mtr.add_suppression("Timeout while waiting for a view change event during the auto-rejoin procedure");

mysql-test/suite/group_replication/r/gr_autorejoin_majority_loss_rejoin_failed_readonly.result

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ SET @debug_saved = @@GLOBAL.DEBUG;
2525
SET @@GLOBAL.DEBUG='+d,group_replication_rejoin_short_retry';
2626
SET @@GLOBAL.DEBUG='+d,group_replication_stop_before_rejoin_loop';
2727
SET @@GLOBAL.DEBUG='+d,group_replication_stop_before_rejoin';
28+
SET @saved_exit_state_action = @@GLOBAL.group_replication_exit_state_action;
29+
SET @@GLOBAL.group_replication_exit_state_action = READ_ONLY;
2830
include/start_and_bootstrap_group_replication.inc
2931
[connection server2]
3032
include/start_group_replication.inc
@@ -80,5 +82,6 @@ include/stop_group_replication.inc
8082
include/start_and_bootstrap_group_replication.inc
8183
SET @@GLOBAL.DEBUG = @debug_saved;
8284
SET @@GLOBAL.group_replication_autorejoin_tries = default;
85+
SET @@GLOBAL.group_replication_exit_state_action = @saved_exit_state_action;
8386
include/gr_end_autorejoin_monitoring.inc
8487
include/group_replication_end.inc

mysql-test/suite/group_replication/r/gr_autorejoin_member_expel_rejoin_failed_readonly.result

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,16 @@ call mtr.add_suppression("Started auto-rejoin procedure attempt*");
1414
call mtr.add_suppression("Auto-rejoin procedure attempt*");
1515
call mtr.add_suppression("Unable to confirm whether the server has left the group or not. Check performance_schema.replication_group_members to check group membership information.");
1616
call mtr.add_suppression("The server was automatically set into read only mode after an error was detected.");
17+
call mtr.add_suppression("The server was automatically set into offline mode after an error was detected.");
1718
SET sql_log_bin = 1;
1819
include/gr_autorejoin_monitoring.inc
1920
SET @debug_saved = @@GLOBAL.DEBUG;
2021
SET @@GLOBAL.DEBUG='+d,group_replication_rejoin_short_retry';
2122
SET @@GLOBAL.DEBUG='+d,group_replication_fail_rejoin';
2223
SET @@GLOBAL.DEBUG='+d,group_replication_stop_before_rejoin_loop';
2324
SET @@GLOBAL.DEBUG='+d,group_replication_stop_before_rejoin';
25+
SET @saved_exit_state_action = @@GLOBAL.group_replication_exit_state_action;
26+
SET @@GLOBAL.group_replication_exit_state_action = READ_ONLY;
2427
include/start_and_bootstrap_group_replication.inc
2528
[connection server2]
2629
include/start_group_replication.inc
@@ -94,5 +97,6 @@ include/rpl_gr_wait_for_number_of_members.inc
9497
[connection server1]
9598
SET @@GLOBAL.DEBUG = @debug_saved;
9699
SET @@GLOBAL.group_replication_autorejoin_tries = default;
100+
SET @@GLOBAL.group_replication_exit_state_action = @saved_exit_state_action;
97101
include/gr_end_autorejoin_monitoring.inc
98102
include/group_replication_end.inc

mysql-test/suite/group_replication/r/gr_autorejoin_member_expel_rejoin_parallel_group_mode_change.result

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ call mtr.add_suppression("Started auto-rejoin procedure attempt*");
1414
call mtr.add_suppression("Auto-rejoin procedure attempt*");
1515
call mtr.add_suppression("The member configuration is not compatible with the group configuration. Variables such as group_replication_single_primary_mode or group_replication_enforce_update_everywhere_checks.*");
1616
call mtr.add_suppression("The server was automatically set into read only mode after an error was detected.");
17+
call mtr.add_suppression("The server was automatically set into offline mode after an error was detected.");
1718
SET sql_log_bin = 1;
1819
include/gr_autorejoin_monitoring.inc
1920
SET @debug_saved = @@GLOBAL.DEBUG;

mysql-test/suite/group_replication/r/gr_autorejoin_monitoring_test.result

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Note #### Storing MySQL user name or password information in the connection meta
1212
SET sql_log_bin = 0;
1313
call mtr.add_suppression("Member was expelled from the group due to network failures, changing member status to ERROR.");
1414
call mtr.add_suppression("The server was automatically set into read only mode after an error was detected.");
15+
call mtr.add_suppression("The server was automatically set into offline mode after an error was detected.");
1516
call mtr.add_suppression("\\[GCS\\] read failed");
1617
call mtr.add_suppression("Started auto-rejoin procedure attempt*");
1718
call mtr.add_suppression("Auto-rejoin procedure attempt*");

mysql-test/suite/group_replication/r/gr_autorejoin_option.result

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Note #### Storing MySQL user name or password information in the connection meta
1212
SET sql_log_bin = 0;
1313
call mtr.add_suppression("Member was expelled from the group due to network failures, changing member status to ERROR.");
1414
call mtr.add_suppression("The server was automatically set into read only mode after an error was detected.");
15+
call mtr.add_suppression("The server was automatically set into offline mode after an error was detected.");
1516
call mtr.add_suppression("\\[GCS\\] The member has left the group but the new view will not be installed*");
1617
call mtr.add_suppression("Started auto-rejoin procedure attempt*");
1718
call mtr.add_suppression("Auto-rejoin procedure attempt*");

mysql-test/suite/group_replication/r/gr_clone_applier_stop.result

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ call mtr.add_suppression("Fatal error during execution on the Applier process of
115115
call mtr.add_suppression("Skipping leave operation: concurrent attempt to leave the group is on-going.");
116116
call mtr.add_suppression("Unable to confirm whether the server has left the group or not. Check performance_schema.replication_group_members to check group membership information.");
117117
call mtr.add_suppression("The server was automatically set into read only mode after an error was detected.");
118+
call mtr.add_suppression("The server was automatically set into offline mode after an error was detected.");
118119
call mtr.add_suppression("Unable to initialize the Group Replication applier module.");
119120
call mtr.add_suppression("There was a previous plugin error while the member joined the group. The member will now exit the group.");
120121
call mtr.add_suppression("This member will start distributed recovery using clone. It is due to the number of missing transactions being higher than the configured threshold of 1.");

mysql-test/suite/group_replication/r/gr_clone_integration_ddl_error.result

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ call mtr.add_suppression("Internal query: CLONE INSTANCE FROM \'root\'@\'127.0.0
7979
call mtr.add_suppression("There was an issue when cloning from another server: Error number: 3862 Error message: Clone Donor Error: 3633 : Concurrent DDL is performed during clone operation. Please try again.");
8080
call mtr.add_suppression("Due to a critical cloning error or lack of donors, distributed recovery cannot be executed. The member will now leave the group.");
8181
call mtr.add_suppression("Skipping leave operation: concurrent attempt to leave the group is on-going.");
82+
call mtr.add_suppression("The server was automatically set into offline mode after an error was detected.");
8283
set session sql_log_bin=1;
8384
[connection server1]
8485
UNINSTALL PLUGIN clone;

mysql-test/suite/group_replication/r/gr_clone_integration_different_recovery_user.result

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ call mtr.add_suppression("The server was automatically set into read only mode a
5959
call mtr.add_suppression("Skipping leave operation: concurrent attempt to leave the group is on-going.");
6060
call mtr.add_suppression("Clone removing all user data for provisioning: Started");
6161
call mtr.add_suppression("Clone removing all user data for provisioning: Finished");
62+
call mtr.add_suppression("The server was automatically set into offline mode after an error was detected.");
6263
SET SESSION sql_log_bin=1;
6364
include/clean_monitoring_process.inc
6465
include/group_replication_end.inc

0 commit comments

Comments
 (0)