| 1 |
include/group_replication.inc |
| 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 |
# Start group replication on server 1. |
| 8 |
server1 |
| 9 |
include/start_and_bootstrap_group_replication.inc |
| 10 |
CREATE TABLE test.t1 (a INT NOT NULL AUTO_INCREMENT PRIMARY KEY , b INT); |
| 11 |
|
| 12 |
##################################################################### |
| 13 |
# Start group replication on server2 and wait for the state to change. |
| 14 |
server2 |
| 15 |
set session sql_log_bin=0; |
| 16 |
call mtr.add_suppression("Transaction cannot be executed while Group Replication is recovering.*"); |
| 17 |
call mtr.add_suppression("Run function 'before_commit' in plugin 'group_replication' failed"); |
| 18 |
set session sql_log_bin=1; |
| 19 |
SET @@GLOBAL.DEBUG='+d,recovery_thread_wait_before_finish'; |
| 20 |
include/start_group_replication.inc |
| 21 |
|
| 22 |
################################################### |
| 23 |
# On server 2 wait for recovery to create the table. |
| 24 |
|
| 25 |
########################################################## |
| 26 |
# On server 2 try to execute a query and see that it fails as the |
| 27 |
# server is in super-read-only mode during recovery. |
| 28 |
INSERT INTO test.t1 (b) VALUES (1); |
| 29 |
ERROR HY000: The MySQL server is running with the --super-read-only option so it cannot execute this statement |
| 30 |
|
| 31 |
################################################################### |
| 32 |
# On server 2 wait for it to become online and re-execute the query |
| 33 |
server2 |
| 34 |
SET DEBUG_SYNC= "now WAIT_FOR signal.recovery_thread_wait_before_finish_reached"; |
| 35 |
SET @@GLOBAL.DEBUG='-d,recovery_thread_wait_before_finish'; |
| 36 |
SET DEBUG_SYNC= "now SIGNAL signal.recovery_end"; |
| 37 |
include/gr_wait_for_member_state.inc |
| 38 |
SET DEBUG_SYNC= 'RESET'; |
| 39 |
INSERT INTO test.t1 (b) VALUES (1); |
| 40 |
include/rpl_sync.inc |
| 41 |
|
| 42 |
####################################################################### |
| 43 |
# Assert that server1 and server2 have the same data and GTID_EXECUTED. |
| 44 |
server1 |
| 45 |
include/assert.inc ['There is a value 1 in table t1 on server1'] |
| 46 |
server2 |
| 47 |
include/assert.inc ['There is a value 1 in table t1 on server2'] |
| 48 |
server1 |
| 49 |
server2 |
| 50 |
include/assert.inc ['server1 and server2 GTID_EXECUTED must be equal'] |
| 51 |
|
| 52 |
######### |
| 53 |
# Cleanup |
| 54 |
DROP TABLE t1; |
| 55 |
include/group_replication_end.inc |