Description:
If a member that has asynchronous channels feeding data into it - either on multi-primary deploy or the primary on single-primary deploy - does stop, all asynchronous channels must be stopped to avoid that changes are made locally (not replicated to the group).
Even when super_read_only it is set on STOP GROUP_REPLICATION, that will not affect already running asynchronous which can still do changes.
How to repeat:
Please run the following test (also on attachment):
--let $group_replication_group_name= 8a94f357-aab4-11df-86ab-c80aa9420002
--source ../inc/have_group_replication_plugin.inc
--let $rpl_skip_group_replication_start= 1
--source ../inc/group_replication.inc
--echo
--echo ############################################################
--echo # 1. Setup Group Replication on server 1.
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
--source ../inc/start_and_bootstrap_group_replication.inc
--echo
--echo ############################################################
--echo # 2. Setup a asynchronous replication connection from server 2
--echo # into group (server 1)
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
--replace_result $SERVER_MYPORT_2 SERVER_2_PORT
--eval CHANGE MASTER TO MASTER_HOST="127.0.0.1", MASTER_USER="root", MASTER_PASSWORD="", MASTER_PORT=$SERVER_MYPORT_2, MASTER_AUTO_POSITION=1
--source include/start_slave.inc
--echo
--echo ############################################################
--echo # 3. Execute some transactions on server 2.
--let $rpl_connection_name= server2
--source include/rpl_connection.inc
CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (0);
--echo
--echo ############################################################
--echo # 4. Wait until transactions executed on server 2 are applied
--echo # on group.
--let $sync_slave_connection= server1
--source include/sync_slave_sql_with_master.inc
--echo
--echo ############################################################
--echo # 5. Stop group.
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
--source include/stop_group_replication.inc
--echo
--echo ############################################################
--echo # 6. Execute data on server 2 and ensure it is not accepted on server 1.
--let $rpl_connection_name= server2
--source include/rpl_connection.inc
INSERT INTO t1 VALUES (1);
--echo
--echo ############################################################
--echo # 6. Validate data on server 1.
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
# FIXME remove sleep
--sleep 3
--let $assert_text= 'There is no value 1 in table t1'
--let $assert_cond= [SELECT COUNT(*) AS count FROM t1 WHERE t1.c1 = 1, count, 1] = 0
--source include/assert.inc
--exit
# FIXME more validations
Suggested fix:
Stop all asynchronous channels on STOP GROUP_REPLICATION.