| 1 |
################################################################################ |
| 2 |
# This test verifies that server doesn't crashes on setting server_id=0. |
| 3 |
# |
| 4 |
# Test: |
| 5 |
# 0. The test requires two servers: M1 and M2. |
| 6 |
# 1. On M1 START GR cmd should error out when server_id=0. |
| 7 |
# 2. On M1 START GR cmd should work fine when setting it back to server_id=1. |
| 8 |
# 3. On M1 insert some data. Validate that same data is present on M2 as well. |
| 9 |
################################################################################ |
| 10 |
|
| 11 |
--source include/big_test.inc |
| 12 |
--source include/have_group_replication_plugin.inc |
| 13 |
--source include/group_replication.inc |
| 14 |
|
| 15 |
--echo |
| 16 |
--echo [SERVER1] |
| 17 |
--connection server1 |
| 18 |
--source include/stop_group_replication.inc |
| 19 |
|
| 20 |
SET SESSION sql_log_bin=0; |
| 21 |
call mtr.add_suppression("Server id not set, will not start replica for channel 'group_replication_applier'"); |
| 22 |
call mtr.add_suppression("Error while starting the group replication applier thread"); |
| 23 |
call mtr.add_suppression("Unable to initialize the Group Replication applier module."); |
| 24 |
call mtr.add_suppression("The member is leaving a group without being on one"); |
| 25 |
call mtr.add_suppression("It was not possible to identify the group replication applier thread"); |
| 26 |
SET SESSION sql_log_bin=1; |
| 27 |
|
| 28 |
SET GLOBAL server_id=0; |
| 29 |
--error ER_BAD_REPLICA, ER_GROUP_REPLICATION_APPLIER_INIT_ERROR |
| 30 |
START GROUP_REPLICATION; |
| 31 |
|
| 32 |
--let $skip_assert_read_only= 1 |
| 33 |
--source include/stop_group_replication.inc |
| 34 |
|
| 35 |
SET GLOBAL server_id=1; |
| 36 |
--source include/start_group_replication.inc |
| 37 |
CREATE TABLE t1(c1 INT PRIMARY KEY); |
| 38 |
INSERT INTO t1 VALUES(1); |
| 39 |
INSERT INTO t1 VALUES(2); |
| 40 |
|
| 41 |
# sync all members |
| 42 |
--source include/rpl_sync.inc |
| 43 |
|
| 44 |
# Validate members state is equal. |
| 45 |
--let $diff_tables= server1:t1, server2:t1 |
| 46 |
--source include/diff_tables.inc |
| 47 |
|
| 48 |
DROP TABLE t1; |
| 49 |
--source include/group_replication_end.inc |