1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
|
include/group_replication.inc
Warnings:
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
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.
[connection server1]
############################################################
# 1. Create a table on server 1 without generating GTID to
# avoid confusion on the test asserts.
[connection server1]
SET SESSION sql_log_bin = 0;
CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY);
SET SESSION sql_log_bin = 1;
############################################################
# 2. Deploy a group on server1 with autocommit disabled and
# super_read_only is enabled.
[connection server1]
SET GLOBAL group_replication_group_name= "GROUP_REPLICATION_GROUP_NAME";
SET @@GLOBAL.super_read_only= 1;
SET @saved_autocommit = @@SESSION.autocommit;
SET @@SESSION.autocommit = 0;
START GROUP_REPLICATION;
COMMIT;
############################################################
# 3. Assert that a View_change_log_event was logged.
[connection server1]
include/gr_wait_for_member_state.inc
include/assert.inc [START GROUP_REPLICATION did generate a GTID]
include/assert_binlog_events.inc [Gtid # Query/BEGIN # View_change # Query/COMMIT]
############################################################
# 4. Stop Group Replication on server1 with autocommit disabled
# and super_read_only is enabled.
[connection server1]
SET @@GLOBAL.super_read_only= 1;
SET @@SESSION.autocommit = 0;
STOP GROUP_REPLICATION;
COMMIT;
############################################################
# 5. Assert that no transaction was logged due to
# STOP GROUP_REPLICATION;
[connection server1]
include/gr_wait_for_member_state.inc
include/assert.inc [STOP GROUP_REPLICATION did not generate a GTID]
include/assert_binlog_events.inc [Gtid # Query/BEGIN # View_change # Query/COMMIT]
############################################################
# 6. Assert that no transaction was logged due to
# STOP GROUP_REPLICATION and that a statement cannot be
# be executed between STOP GROUP_REPLICATION and COMMIT
# when autocommit is disabled.
[connection server1]
include/start_and_bootstrap_group_replication.inc
include/assert.inc [START GROUP_REPLICATION did generate a GTID]
include/assert_binlog_events.inc [Gtid # Query/BEGIN # View_change # Query/COMMIT # Gtid # Query/BEGIN # View_change # Query/COMMIT]
SET @@GLOBAL.read_only= 0;
SET @@SESSION.autocommit = 0;
STOP GROUP_REPLICATION;
INSERT INTO t1 VALUES (1);
ERROR HY000: The MySQL server is running with the --super-read-only option so it cannot execute this statement
COMMIT;
include/assert.inc [STOP GROUP_REPLICATION did not generate a GTID]
include/assert_binlog_events.inc [Gtid # Query/BEGIN # View_change # Query/COMMIT # Gtid # Query/BEGIN # View_change # Query/COMMIT]
include/assert.inc ['Table t1 must be empty']
############################################################
# 7. Clean up.
[connection server1]
SET @@SESSION.autocommit = @saved_autocommit;
SET @@GLOBAL.read_only= 0;
SET SESSION sql_log_bin = 0;
DROP TABLE t1;
SET SESSION sql_log_bin = 1;
include/group_replication_end.inc
|