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
|
# ==== Implementation ====
#
# Setup a group with two servers. Enable MTS in server2 and allow it to join the
# group. Wait for the join to finish (i.e., the two view change transaction have
# already been applied). Check that no inactive worker (corresponding to the
# group_replication_recovey channel) is still applying a transaction.
#
# ==== Related Bug ====
#
# Bug#25896166 APPLYING_TRANSACTION.R..A..S_BY_WORKER COL DOESN'T GET CLEARED
# FOR GR RECOVERY
#
# the test enables MTS in one server
--source include/have_group_replication_plugin.inc
--let $rpl_skip_group_replication_start= 1
--source include/group_replication.inc
# start group replication on server1
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
--source include/start_and_bootstrap_group_replication.inc
# enable MTS in server2
--let $rpl_connection_name= server2
--source include/rpl_connection.inc
# Save defaults.
SET @replica_parallel_type_saved= @@GLOBAL.REPLICA_PARALLEL_TYPE;
SET @replica_parallel_workers_saved= @@GLOBAL.REPLICA_PARALLEL_WORKERS;
SET @slave_preserver_commit_order_saved= @@GLOBAL.REPLICA_PRESERVE_COMMIT_ORDER;
#
SET GLOBAL replica_parallel_type= 'LOGICAL_CLOCK';
SET GLOBAL replica_parallel_workers= 4;
SET GLOBAL replica_preserve_commit_order= ON;
CHANGE REPLICATION SOURCE TO SOURCE_USER='root', SOURCE_PASSWORD='' FOR CHANNEL 'group_replication_recovery';
--source include/start_group_replication.inc
# check that both view change transactions have been executed
--let $assert_text= GTID_EXECUTED must be UUID:1-2
--let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "$group_replication_group_name:1-2"
--source include/assert.inc
# check that no inactive worker has applying transactions
--let $assert_text= There can be no applying transactions when the service state is off
--let $assert_cond= [SELECT COUNT(*) AS count FROM performance_schema.replication_applier_status_by_worker WHERE SERVICE_STATE = "OFF" AND APPLYING_TRANSACTION != "", count, 1] = "0"
--source include/assert.inc
# Restore defaults
SET @@GLOBAL.REPLICA_PARALLEL_TYPE= @replica_parallel_type_saved;
--disable_warnings
SET @@GLOBAL.REPLICA_PARALLEL_WORKERS= @replica_parallel_workers_saved;
--enable_warnings
SET @@GLOBAL.REPLICA_PRESERVE_COMMIT_ORDER= @slave_preserver_commit_order_saved;
--source include/stop_group_replication.inc
--source include/group_replication_end.inc
|