| 1 |
include/group_replication.inc [rpl_server_count=3] |
| 2 |
Warnings: |
| 3 |
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. |
| 4 |
Note #### Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information. |
| 5 |
[connection server1] |
| 6 |
|
| 7 |
# 0. Group start in Single Primary mode with 3 servers |
| 8 |
set session sql_log_bin=0; |
| 9 |
call mtr.add_suppression("The server was automatically set into read only mode after an error was detected."); |
| 10 |
call mtr.add_suppression("A configuration change was killed in this member. The member will now leave the group as its configuration may have diverged."); |
| 11 |
call mtr.add_suppression("Skipping leave operation: concurrent attempt to leave the group is on-going."); |
| 12 |
call mtr.add_suppression("The function 'group_replication_switch_to_multi_primary_mode' failed. This operation was locally killed and for that reason terminated.*"); |
| 13 |
set session sql_log_bin=1; |
| 14 |
include/start_and_bootstrap_group_replication.inc |
| 15 |
[connection server2] |
| 16 |
include/start_group_replication.inc |
| 17 |
[connection server3] |
| 18 |
include/start_group_replication.inc |
| 19 |
|
| 20 |
# 1. Begin a transaction on server 1 but do not commit it |
| 21 |
[connection server_1_1] |
| 22 |
CREATE TABLE test.t1 (a INT PRIMARY KEY); |
| 23 |
include/rpl_sync.inc |
| 24 |
BEGIN; |
| 25 |
INSERT INTO t1 VALUES (1); |
| 26 |
|
| 27 |
# 2. Do a change to multi primary mode |
| 28 |
# Get the connection ID |
| 29 |
# See that it is stuck waiting for current transactions |
| 30 |
[connection server1] |
| 31 |
SELECT group_replication_switch_to_multi_primary_mode(); |
| 32 |
[connection server_1] |
| 33 |
[connection server3] |
| 34 |
|
| 35 |
# 3. Kill the query |
| 36 |
[connection server_1] |
| 37 |
KILL QUERY CONNECTION_ID; |
| 38 |
|
| 39 |
# 4. Commit transaction and member will finish the UDF |
| 40 |
[connection server_1_1] |
| 41 |
COMMIT; |
| 42 |
include/rpl_sync.inc |
| 43 |
[connection server1] |
| 44 |
group_replication_switch_to_multi_primary_mode() |
| 45 |
Mode switched to multi-primary successfully. |
| 46 |
|
| 47 |
# 5. Unlock the table, check the action completed in the other members |
| 48 |
[connection server_2] |
| 49 |
include/gr_assert_multi_primary_mode.inc |
| 50 |
[connection server3] |
| 51 |
include/gr_assert_multi_primary_mode.inc |
| 52 |
[connection server1] |
| 53 |
include/gr_assert_multi_primary_mode.inc |
| 54 |
|
| 55 |
# 6. Cleanup |
| 56 |
[connection server2] |
| 57 |
DROP TABLE t1; |
| 58 |
include/group_replication_end.inc |