Debian Codegraph @

mysql-test/suite/group_replication/t/gr_ps_applying_trx_recovery_channel.test

raw
1 # ==== Implementation ====
2 #
3 # Setup a group with two servers. Enable MTS in server2 and allow it to join the
4 # group. Wait for the join to finish (i.e., the two view change transaction have
5 # already been applied). Check that no inactive worker (corresponding to the
6 # group_replication_recovey channel) is still applying a transaction.
7 #
8 # ==== Related Bug ====
9 #
10 # Bug#25896166 APPLYING_TRANSACTION.R..A..S_BY_WORKER COL DOESN'T GET CLEARED
11 # FOR GR RECOVERY
12 #
13
14 # the test enables MTS in one server
15 --source include/have_group_replication_plugin.inc
16 --let $rpl_skip_group_replication_start= 1
17 --source include/group_replication.inc
18
19 # start group replication on server1
20 --let $rpl_connection_name= server1
21 --source include/rpl_connection.inc
22 --source include/start_and_bootstrap_group_replication.inc
23
24 # enable MTS in server2
25 --let $rpl_connection_name= server2
26 --source include/rpl_connection.inc
27 # Save defaults.
28 SET @replica_parallel_type_saved= @@GLOBAL.REPLICA_PARALLEL_TYPE;
29 SET @replica_parallel_workers_saved= @@GLOBAL.REPLICA_PARALLEL_WORKERS;
30 SET @slave_preserver_commit_order_saved= @@GLOBAL.REPLICA_PRESERVE_COMMIT_ORDER;
31 #
32 SET GLOBAL replica_parallel_type= 'LOGICAL_CLOCK';
33 SET GLOBAL replica_parallel_workers= 4;
34 SET GLOBAL replica_preserve_commit_order= ON;
35 CHANGE REPLICATION SOURCE TO SOURCE_USER='root', SOURCE_PASSWORD='' FOR CHANNEL 'group_replication_recovery';
36 --source include/start_group_replication.inc
37
38 # check that both view change transactions have been executed
39 --let $assert_text= GTID_EXECUTED must be UUID:1-2
40 --let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "$group_replication_group_name:1-2"
41 --source include/assert.inc
42
43 # check that no inactive worker has applying transactions
44 --let $assert_text= There can be no applying transactions when the service state is off
45 --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"
46 --source include/assert.inc
47
48 # Restore defaults
49 SET @@GLOBAL.REPLICA_PARALLEL_TYPE= @replica_parallel_type_saved;
50 --disable_warnings
51 SET @@GLOBAL.REPLICA_PARALLEL_WORKERS= @replica_parallel_workers_saved;
52 --enable_warnings
53 SET @@GLOBAL.REPLICA_PRESERVE_COMMIT_ORDER= @slave_preserver_commit_order_saved;
54 --source include/stop_group_replication.inc
55 --source include/group_replication_end.inc