| 1 |
|
| 2 |
############################################################## |
| 3 |
# 1. Create a table on the source and sync |
| 4 |
include/master-slave.inc |
| 5 |
Warnings: |
| 6 |
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. |
| 7 |
Note #### Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information. |
| 8 |
[connection master] |
| 9 |
CREATE TABLE t1 (c1 INT PRIMARY KEY); |
| 10 |
include/sync_slave_sql_with_master.inc |
| 11 |
|
| 12 |
############################################################## |
| 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 |
# Adding debug point 'wait_before_purge_applied_logs' to @@GLOBAL.debug |
| 16 |
INSERT INTO t1 VALUES (1); |
| 17 |
[connection server_2] |
| 18 |
LOCK TABLES t1 WRITE; |
| 19 |
|
| 20 |
############################################################## |
| 21 |
# 3. Add data on the source that will cause an error on the replica |
| 22 |
# Also execute a FLUSH to cause a log rotation in the replica |
| 23 |
[connection master] |
| 24 |
INSERT INTO t1 VALUES (1); |
| 25 |
FLUSH LOGS; |
| 26 |
INSERT INTO t1 VALUES (2); |
| 27 |
|
| 28 |
############################################################## |
| 29 |
# 4. Wait for the debug point to be reached and unlock the table |
| 30 |
# Signal the debug point to continue |
| 31 |
[connection server_2] |
| 32 |
SET DEBUG_SYNC = "now WAIT_FOR signal.rpl_before_applier_purge_logs"; |
| 33 |
UNLOCK TABLES; |
| 34 |
[connection slave] |
| 35 |
SET DEBUG_SYNC= 'now SIGNAL signal.rpl_unblock_purge'; |
| 36 |
# Removing debug point 'wait_before_purge_applied_logs' from @@GLOBAL.debug |
| 37 |
|
| 38 |
############################################################## |
| 39 |
# 5. Check no error was logged |
| 40 |
include/assert.inc [No error about writting to the relay log was found] |
| 41 |
|
| 42 |
############################################################## |
| 43 |
# 6. Cleanup |
| 44 |
DELETE FROM t1 WHERE c1 = 1; |
| 45 |
include/start_slave.inc |
| 46 |
include/suppress_messages.inc |
| 47 |
# Connection 2 suppresses message <Worker 1 failed executing transaction>. |
| 48 |
# Connection 2 suppresses message <The replica coordinator and worker threads are stopped, possibly leaving data in inconsistent state.>. |
| 49 |
# Connection 2 suppresses message <Replica worker thread has failed to apply an event.>. |
| 50 |
# Connection 2 suppresses message <Error writing relay log repository data while a thread is being killed>. |
| 51 |
[connection master] |
| 52 |
DROP TABLE t1; |
| 53 |
include/rpl_end.inc |