| 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 |
# BUG#25694813 INSTRUMENTATION IS ALWAYS ENABLED FOR REPLICATION P_S STATUS |
| 39 |
# TABLES |
| 40 |
|
| 41 |
--source include/not_mts_replica_parallel_workers.inc |
| 42 |
# the test is binlog-format agnostic |
| 43 |
--source include/have_binlog_format_row.inc |
| 44 |
--source include/have_debug_sync.inc |
| 45 |
--source include/master-slave.inc |
| 46 |
|
| 47 |
--let $is_mts= 0 |
| 48 |
|
| 49 |
--source extra/rpl_tests/rpl_ps_connection_applier_status.inc |
| 50 |
|
| 51 |
--source extra/rpl_tests/rpl_ps_connection_applier_status_by_worker_failed_trx.inc |
| 52 |
|
| 53 |
# check if transaction information in the the coordinator ps schema table was |
| 54 |
# reset when restarting an STS slave with MTS enabled. |
| 55 |
--source include/rpl_connection_slave.inc |
| 56 |
--source include/stop_slave.inc |
| 57 |
SET GLOBAL replica_parallel_workers= 4; |
| 58 |
--source include/start_slave.inc |
| 59 |
|
| 60 |
--let $processing_gtid_= query_get_value(SELECT PROCESSING_TRANSACTION FROM performance_schema.replication_applier_status_by_coordinator, PROCESSING_TRANSACTION, 1) |
| 61 |
--let $assert_text= processing_gtid is cleared when a former STS slave restarts with MTS enabled |
| 62 |
--let $assert_cond= "$processing_gtid" = "" |
| 63 |
--source include/assert.inc |
| 64 |
|
| 65 |
--let $last_processed_gtid= query_get_value(SELECT LAST_PROCESSED_TRANSACTION FROM performance_schema.replication_applier_status_by_coordinator, LAST_PROCESSED_TRANSACTION, 1) |
| 66 |
--let $assert_text= last_processed_gtid is cleared when a former STS slave restarts with MTS enabled |
| 67 |
--let $assert_cond= "$last_processed_gtid" = "" |
| 68 |
--source include/assert.inc |
| 69 |
|
| 70 |
#cleanup |
| 71 |
--source include/stop_slave.inc |
| 72 |
SET GLOBAL replica_parallel_workers= 0; |
| 73 |
--source include/start_slave.inc |
| 74 |
--source include/rpl_end.inc |