Debian Codegraph @

mysql-test/suite/rpl/t/rpl_perfschema_connection_applier_status.test

raw
1 #
2 # ==== Purpose ====
3 #
4 # This test asserts that the information regarding the replication timestamps
5 # is displayed correctly when the system is running with MTS disabled.
6 #
7 # ==== Implementation ====
8 #
9 # Five transaction types are tested:
10 # - create table
11 # - insert
12 # - update
13 # - delete
14 # - drop table
15 # For each statement, the test asserts that the information concerning the
16 # transaction that is currently being processed matches what is expected
17 # before and after each of the following replication stages is completed for
18 # that transaction:
19 # 1) The connection thread queues the transaction to be applied by the applier
20 # thread (table: performance_schema.replication_connection_status)
21 # 2) The applier thread applies the transaction
22 # (table: performance_schema.replication_applier_status_by_worker)
23 #
24 # The second part of the test checks if the table
25 # performance_schema.replication_applier_status_by_worker displays the correct
26 # information when the slave cannot apply a transaction due to an error.
27 # Two types of transactions are tested: DDL (DROP table) and DML (insert). After
28 # the slave fails applying each transaction, the test verifies that
29 # last_applied_transaction still shows the last transaction applied before the
30 # failed one, and also that applying_transaction was cleared.
31 # Also check that when an STS slave is restarted with MTS enabled, the table
32 # performance_schema.replication_applier_status_by_coordinator shows the
33 # appropriate information.
34 #
35 # ==== References ====
36 #
37 # WL#7374 Performance schema tables to monitor replication lags and queue
38
39 --source include/not_mts_replica_parallel_workers.inc
40 # the test is binlog-format agnostic
41 --source include/have_binlog_format_row.inc
42 --source include/have_debug_sync.inc
43 --source include/master-slave.inc
44
45 --let $is_mts= 0
46
47 --source extra/rpl_tests/rpl_ps_connection_applier_status.inc
48
49 --source extra/rpl_tests/rpl_ps_connection_applier_status_by_worker_failed_trx.inc
50
51 # check if transaction information in the the coordinator ps schema table was
52 # reset when restarting an STS slave with MTS enabled.
53 --source include/rpl_connection_slave.inc
54 --source include/stop_slave.inc
55 SET GLOBAL replica_parallel_workers= 4;
56 --source include/start_slave.inc
57
58 --let $processing_gtid_= query_get_value(SELECT PROCESSING_TRANSACTION FROM performance_schema.replication_applier_status_by_coordinator, PROCESSING_TRANSACTION, 1)
59 --let $assert_text= processing_gtid is cleared when a former STS slave restarts with MTS enabled
60 --let $assert_cond= "$processing_gtid" = ""
61 --source include/assert.inc
62
63 --let $last_processed_gtid= query_get_value(SELECT LAST_PROCESSED_TRANSACTION FROM performance_schema.replication_applier_status_by_coordinator, LAST_PROCESSED_TRANSACTION, 1)
64 --let $assert_text= last_processed_gtid is cleared when a former STS slave restarts with MTS enabled
65 --let $assert_cond= "$last_processed_gtid" = ""
66 --source include/assert.inc
67
68 #cleanup
69 --source include/stop_slave.inc
70 SET GLOBAL replica_parallel_workers= 0;
71 --source include/start_slave.inc
72 --source include/rpl_end.inc