| 1 |
# === Purpose === |
| 2 |
# |
| 3 |
# This test checks that when the coordinator is killed it does not log errors while rotating a log |
| 4 |
# |
| 5 |
# ==== Requirements ==== |
| 6 |
# |
| 7 |
# R1. When a error happens while applying data, the server should not log errors |
| 8 |
# related to writing in the replica repository when the coordinator is killed. |
| 9 |
# |
| 10 |
# === Implementation ==== |
| 11 |
# |
| 12 |
# 1. Create a table on the source and sync |
| 13 |
# 2. Add a debug point to the replica so it stops during a log rotation |
| 14 |
# Also lock table t1 to insure the error only happens when the relay log is being rotated |
| 15 |
# 3. Add data on the source that will cause an error on the replica |
| 16 |
# Also execute a FLUSH to cause a log rotation in the replica |
| 17 |
# 4. Wait for the debug point to be reached and unlock the table |
| 18 |
# Signal the debug point to continue |
| 19 |
# 5. Check no error was logged |
| 20 |
# 6. Cleanup |
| 21 |
# |
| 22 |
# === References === |
| 23 |
# |
| 24 |
# Bug#19820134 SOME RPL SUITES FAILS WITH ERROR WRITING RELAY LOG CONFIGURATION |
| 25 |
# |
| 26 |
|
| 27 |
--source include/have_debug.inc |
| 28 |
--source include/have_debug_sync.inc |
| 29 |
--source include/have_binlog_format_row.inc |
| 30 |
--source include/only_mts_replica_parallel_workers.inc |
| 31 |
|
| 32 |
--echo |
| 33 |
--echo ############################################################## |
| 34 |
--echo # 1. Create a table on the source and sync |
| 35 |
|
| 36 |
--source include/master-slave.inc |
| 37 |
|
| 38 |
CREATE TABLE t1 (c1 INT PRIMARY KEY); |
| 39 |
|
| 40 |
--source include/sync_slave_sql_with_master.inc |
| 41 |
|
| 42 |
--echo |
| 43 |
--echo ############################################################## |
| 44 |
--echo # 2. Add a debug point to the replica so it stops during a log rotation |
| 45 |
--echo # Also lock table t1 to insure the error only happens when the relay log is being rotated |
| 46 |
|
| 47 |
--let $debug_point= wait_before_purge_applied_logs |
| 48 |
--source include/add_debug_point.inc |
| 49 |
|
| 50 |
INSERT INTO t1 VALUES (1); |
| 51 |
|
| 52 |
--let $rpl_connection_name= server_2 |
| 53 |
--source include/rpl_connection.inc |
| 54 |
|
| 55 |
LOCK TABLES t1 WRITE; |
| 56 |
|
| 57 |
--echo |
| 58 |
--echo ############################################################## |
| 59 |
--echo # 3. Add data on the source that will cause an error on the replica |
| 60 |
--echo # Also execute a FLUSH to cause a log rotation in the replica |
| 61 |
|
| 62 |
--source include/rpl_connection_master.inc |
| 63 |
|
| 64 |
INSERT INTO t1 VALUES (1); |
| 65 |
|
| 66 |
FLUSH LOGS; |
| 67 |
|
| 68 |
INSERT INTO t1 VALUES (2); |
| 69 |
|
| 70 |
--echo |
| 71 |
--echo ############################################################## |
| 72 |
--echo # 4. Wait for the debug point to be reached and unlock the table |
| 73 |
--echo # Signal the debug point to continue |
| 74 |
|
| 75 |
--let $rpl_connection_name= server_2 |
| 76 |
--source include/rpl_connection.inc |
| 77 |
|
| 78 |
SET DEBUG_SYNC = "now WAIT_FOR signal.rpl_before_applier_purge_logs"; |
| 79 |
|
| 80 |
UNLOCK TABLES; |
| 81 |
|
| 82 |
--source include/rpl_connection_slave.inc |
| 83 |
|
| 84 |
# Ensure the worker fails |
| 85 |
--let $wait_condition= SELECT COUNT(*)>=1 FROM performance_schema.error_log WHERE error_code='MY-010584' AND data LIKE "%Could not execute Write_rows event on table test.t1;%" |
| 86 |
--source include/wait_condition.inc |
| 87 |
|
| 88 |
SET DEBUG_SYNC= 'now SIGNAL signal.rpl_unblock_purge'; |
| 89 |
|
| 90 |
--let $debug_point= wait_before_purge_applied_logs |
| 91 |
--source include/remove_debug_point.inc |
| 92 |
|
| 93 |
--echo |
| 94 |
--echo ############################################################## |
| 95 |
--echo # 5. Check no error was logged |
| 96 |
|
| 97 |
# Give it time to log something |
| 98 |
--sleep 1 |
| 99 |
|
| 100 |
--let $assert_text= No error about writting to the relay log was found |
| 101 |
--let $assert_cond= "[SELECT COUNT(*) as count FROM performance_schema.error_log WHERE error_code=\'MY-010608\' AND data LIKE \"%Error writing relay log configuration%\", count, 1]" = "0" |
| 102 |
--source include/assert.inc |
| 103 |
|
| 104 |
--echo |
| 105 |
--echo ############################################################## |
| 106 |
--echo # 6. Cleanup |
| 107 |
|
| 108 |
DELETE FROM t1 WHERE c1 = 1; |
| 109 |
|
| 110 |
--source include/start_slave.inc |
| 111 |
|
| 112 |
let $messages = |
| 113 |
Worker 1 failed executing transaction |
| 114 |
The replica coordinator and worker threads are stopped, possibly leaving data in inconsistent state. |
| 115 |
Replica worker thread has failed to apply an event. |
| 116 |
Error writing relay log repository data while a thread is being killed |
| 117 |
; |
| 118 |
--let $suppress_on_current_connection = 1 |
| 119 |
--source include/suppress_messages.inc |
| 120 |
|
| 121 |
--source include/rpl_connection_master.inc |
| 122 |
|
| 123 |
DROP TABLE t1; |
| 124 |
|
| 125 |
--source include/rpl_end.inc |