From 11597e02f3bcca6d3f7b7992c0fa63e45e614b1c Mon Sep 17 00:00:00 2001 From: Sujatha Date: Tue, 4 May 2021 15:40:05 +0530 Subject: [PATCH] MDEV-25502: rpl.rpl_perfschema_applier_status_by_worker failed in bb with: Test assertion failed Problem: ======= Test assertion fails on slave. Assertion text: 'Last_Seen_Transaction should show .' Assertion condition: '"0-1-1" = ""' Assertion condition, interpolated: '"0-1-1" = ""' Assertion result: '0' Analysis: ======== Test case creates a table on master and it waits for it to be replicated to slave and applied by slave applier. On completion 'Last_Seen_Transaction' value from 'performance_schema.replication_applier_status_by_worker' table is compared with '@@gtid_slave_pos' to ensure its correctness. The test should ensure that user table and 'gtid_slave_pos' table are of same engine type 'InnoDB' to get consistent test results. This guarantees that 'gtid_slave_pos' table is updated as part of transaction commit. In the of such an engine consistency, user table gets created in default MyISAM storage engine and 'mysql.gtid_slave_pos' table gets created in Aria storage engine. When the test code reaches above assert there might be a delay in an update to 'gtid_slave_pos' table, which leads to test assertion failure. Fix: === Use InnoDB engine for both user table and 'mysql.gtid_slave_pos' table. --- .../rpl/r/rpl_perfschema_applier_status_by_worker.result | 3 ++- .../rpl/t/rpl_perfschema_applier_status_by_worker.test | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/mysql-test/suite/rpl/r/rpl_perfschema_applier_status_by_worker.result b/mysql-test/suite/rpl/r/rpl_perfschema_applier_status_by_worker.result index 3545dc606ac..a2d336ddad7 100644 --- a/mysql-test/suite/rpl/r/rpl_perfschema_applier_status_by_worker.result +++ b/mysql-test/suite/rpl/r/rpl_perfschema_applier_status_by_worker.result @@ -13,6 +13,7 @@ RESET SLAVE ALL; CHANGE MASTER 'slave1' TO MASTER_USER='root',MASTER_PORT=$MASTER_MYPORT, MASTER_HOST='127.0.0.1', MASTER_USE_GTID=slave_pos; SET default_master_connection='slave1'; SET @@global.slave_parallel_workers=1; +ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; START SLAVE 'slave1'; include/wait_for_slave_to_start.inc include/assert.inc [Channel_name will be empty for a worker when it has not processed any transaction] @@ -20,7 +21,7 @@ include/assert.inc [thread_name should should indicate worker thread.] include/assert.inc [Service_State should be "ON" on a fresh slave server.] include/assert.inc [Last_Seen_Transaction should show "" if no transaction applierd] connection master; -CREATE TABLE t1 (a INT); +CREATE TABLE t1 (a INT) ENGINE=InnoDB; connection slave; include/assert.inc [Channel_name must be slave1] include/assert.inc [Last_Seen_Transaction should show 0-1-1.] diff --git a/mysql-test/suite/rpl/t/rpl_perfschema_applier_status_by_worker.test b/mysql-test/suite/rpl/t/rpl_perfschema_applier_status_by_worker.test index 48efbae62db..16e33708c55 100644 --- a/mysql-test/suite/rpl/t/rpl_perfschema_applier_status_by_worker.test +++ b/mysql-test/suite/rpl/t/rpl_perfschema_applier_status_by_worker.test @@ -1,4 +1,3 @@ ---source include/have_perfschema.inc # ==== Purpose ==== # # This test script serves as the functionality testing for the table @@ -33,7 +32,9 @@ # # MDEV-20220: Merge 5.7 P_S replication table 'replication_applier_status_by_worker # +--source include/have_perfschema.inc --source include/have_binlog_format_mixed.inc +--source include/have_innodb.inc --source include/master-slave.inc @@ -54,6 +55,7 @@ RESET SLAVE ALL; evalp CHANGE MASTER 'slave1' TO MASTER_USER='root',MASTER_PORT=$MASTER_MYPORT, MASTER_HOST='127.0.0.1', MASTER_USE_GTID=slave_pos; SET default_master_connection='slave1'; SET @@global.slave_parallel_workers=1; +ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; START SLAVE 'slave1'; --source include/wait_for_slave_to_start.inc @@ -80,7 +82,7 @@ let $assert_cond= "$ps_value" = ""; source include/assert.inc; --connection master -CREATE TABLE t1 (a INT); +CREATE TABLE t1 (a INT) ENGINE=InnoDB; --save_master_pos --connection slave