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 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
|
# Inorder to grep a specific error pattern in error log a fresh error log
# needs to be generated.
--source include/force_restart.inc
--source include/have_binlog_format_statement.inc
--source include/only_mts_replica_parallel_workers.inc
--source include/master-slave.inc
#
# Proving correct error reporting by Worker in condition of the failing query
# size is close to that of internal buffer MAX_SLAVE_ERRMSG.
# bug#18563480 MTS: CRASH WHEN SLAVE WORKER TRY TO EXECUTE A BIG STATEMENT doomed to fail
#
# Create a table on the slave to set up future error on its creation
# via replication
--connection slave
call mtr.add_suppression("Replica SQL for channel '': Worker.*failed executing transaction");
call mtr.add_suppression("Replica SQL for channel '':.*The replica coordinator and worker threads are stopped");
--eval CREATE TABLE t (a TEXT) select "a" as a
# Create a query size of over MAX_SLAVE_ERRMSG = 1024
--connection master
--let i=0
--let select_arg=a
while ($i < 1024)
{
--inc $i
--let $select_arg=a$select_arg
}
--eval CREATE TABLE t (a TEXT) select "$select_arg" as a
--connection slave
# Error is found as expected.
--let $slave_sql_errno= convert_error(ER_TABLE_EXISTS_ERROR)
--source include/wait_for_slave_sql_error.inc
# The next assertion is related to:
# BUG#25231367: INCONSISTENT WORKER_ID BETWEEN RPL P_S TABLES AND MTS ERROR
# MESSAGES
# It checks if the WORKER_ID of the worker reporting the failure in the
# replication_applier_status_by_worker table is the same informed in the
# reported error message.
--let $ps_from_clause= FROM performance_schema.replication_applier_status_by_worker WHERE LAST_ERROR_NUMBER <> 0
--let $ps_worker_id= `SELECT CONCAT("Worker ", WORKER_ID) $ps_from_clause`
--let $msg_worker_id= `SELECT LEFT(LAST_ERROR_MESSAGE, LENGTH("$ps_worker_id")) $ps_from_clause`
--let $assert_text= Error message should report same worker ID as WORKER_ID field in P_S tables
--let $assert_cond= "$ps_worker_id" = "$msg_worker_id"
--source include/assert.inc
# Remove slave side table, recover slave to catch up
DROP TABLE t;
--source include/start_slave_sql.inc
--connection master
--source include/sync_slave_sql_with_master.inc
#
# Cleanup
#
--connection master
DROP TABLE t;
--source include/sync_slave_sql_with_master.inc
# Bug#21198611: MULTI-THREADED SLAVE LOG SPAMMING ON FAILURE
# When a multi-threaded slave stops with an error, the same error message is
# printed three times.
# Steps that are executed above ensure that MTS slave stops with an error.
# Following lines check that "The slave coordinator and worker threads are
# stopped..." error message is printed only once in the error log.
--let $expected_errno= convert_error(ER_MTA_INCONSISTENT_DATA)
--let $expected_errno= MY-00$expected_errno
--replace_regex /[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9]\.[0-9][0-9][0-9][0-9][0-9][0-9][-+Z][0-9:]* *[0-9]* \[Warning\] \[[^[]+\] */DATE_TIME [Warning] /
--replace_result $expected_errno ER_MTA_INCONSISTENT_DATA
--let GREP_FILE=$MYSQLTEST_VARDIR/tmp/slave.err
--let GREP_PATTERN=The replica coordinator and worker threads are stopped
--source include/grep_pattern.inc
--source include/rpl_end.inc
|