| 1 |
include/master-slave.inc |
| 2 |
Warnings: |
| 3 |
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. |
| 4 |
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. |
| 5 |
[connection master] |
| 6 |
call mtr.add_suppression("Error 'Table 'test.t' doesn't exist' on query."); |
| 7 |
call mtr.add_suppression("The replica coordinator and worker threads are stopped, possibly leaving data in inconsistent state."); |
| 8 |
call mtr.add_suppression("Request to stop replica SQL Thread received while applying a group that has non-transactional changes;"); |
| 9 |
include/assert.inc [On master, the table should return an empty set.] |
| 10 |
|
| 11 |
# Setup MTS and perform testing on a fresh slave. |
| 12 |
|
| 13 |
include/sync_slave_sql_with_master.inc |
| 14 |
include/stop_slave.inc |
| 15 |
SET @save_replica_parallel_workers=@@global.replica_parallel_workers; |
| 16 |
SET @@global.replica_parallel_workers=0; |
| 17 |
Warnings: |
| 18 |
Warning 1287 '0' is deprecated and will be removed in a future release. Please use 1 instead |
| 19 |
set @save_replica_transaction_retries= @@global.replica_transaction_retries; |
| 20 |
include/start_slave.inc |
| 21 |
include/assert.inc [In non-MTS mode(SQL thread), the table should return one row as Single SQL applier thread will be part of replication_applier_status_by_worker table.] |
| 22 |
include/assert.inc [In non-MTS mode(SQL thread), the table should return empty result set] |
| 23 |
include/stop_slave.inc |
| 24 |
SET @@global.replica_parallel_workers=1; |
| 25 |
set @save_replica_transaction_retries= @@global.replica_transaction_retries; |
| 26 |
include/start_slave.inc |
| 27 |
include/assert.inc [Worker_Id should be 1] |
| 28 |
include/assert.inc [thread_name should should indicate worker thread.] |
| 29 |
include/assert.inc [Service_State should be "ON" on a fresh slave server.] |
| 30 |
CREATE TABLE t1 (a INT); |
| 31 |
DROP TABLE t1; |
| 32 |
include/assert.inc [Value returned by SSS and PS table for Last_Error_Number should be same.] |
| 33 |
include/assert.inc [Value returned by SSS and PS table for Last_Error_Message should both be empty.] |
| 34 |
include/assert.inc [Value returned by PS table for Last_Error_Timestamp should be 0000-00-00 00:00:00.000000.] |
| 35 |
|
| 36 |
# Introduce an error in the worker thread and check for the correctness |
| 37 |
# of error number, message and timestamp fields. |
| 38 |
|
| 39 |
use test; |
| 40 |
create table t(a int primary key); |
| 41 |
drop table t; |
| 42 |
insert into t values(1); |
| 43 |
include/wait_for_slave_sql_error.inc [errno=1146] |
| 44 |
|
| 45 |
# Extract the error related fields from SSS and PS table and compare |
| 46 |
# them for correctness. |
| 47 |
|
| 48 |
include/assert.inc [Value returned by SSS and PS table for Last_Error_Number should be same.] |
| 49 |
Last_Error_Message |
| 50 |
Worker 1 failed executing transaction 'ANONYMOUS' at source log FILENAME, end_log_pos POSITION; Error 'Table 'test.t' doesn't exist' on query. Default database: 'test'. Query: 'insert into t values(1)' |
| 51 |
include/assert.inc [Value returned by SSS and PS table for Last_Error_Timestamp should be same.] |
| 52 |
|
| 53 |
# Verify that the error fields are preserved after STOP SLAVE. |
| 54 |
|
| 55 |
|
| 56 |
# 1. Verify that thread_id changes to NULL and service_state to "off" on |
| 57 |
# STOP SLAVE. |
| 58 |
|
| 59 |
include/assert.inc [After STOP SLAVE, thread_id should be NULL] |
| 60 |
include/assert.inc [So, Service_State after STOP SLAVE should be "OFF".] |
| 61 |
|
| 62 |
# 2. Extract the worker_id and the error related fields from SSS and PS |
| 63 |
# table and compare them. These fields should preserve their values. |
| 64 |
|
| 65 |
include/assert.inc [Worker_Id should be 1] |
| 66 |
include/assert.inc [Value returned by SSS and PS table for Last_Error_Number should be same.] |
| 67 |
Last_Error_Message |
| 68 |
Worker 1 failed executing transaction 'ANONYMOUS' at source log FILENAME, end_log_pos POSITION; Error 'Table 'test.t' doesn't exist' on query. Default database: 'test'. Query: 'insert into t values(1)' |
| 69 |
include/assert.inc [Value returned by SSS and PS table for Last_Error_Timestamp should be same.] |
| 70 |
stop slave; |
| 71 |
Warnings: |
| 72 |
Warning 1287 'STOP SLAVE' is deprecated and will be removed in a future release. Please use STOP REPLICA instead |
| 73 |
reset slave; |
| 74 |
Warnings: |
| 75 |
Warning 1287 'RESET SLAVE' is deprecated and will be removed in a future release. Please use RESET REPLICA instead |
| 76 |
drop table t; |
| 77 |
reset master; |
| 78 |
|
| 79 |
# Set up replication in gtid-mode=on and test 'Last_Seen_Transaction' |
| 80 |
# field. |
| 81 |
|
| 82 |
include/rpl_set_gtid_mode.inc [ON on servers 1,2] |
| 83 |
stop slave; |
| 84 |
Warnings: |
| 85 |
Warning 1287 'STOP SLAVE' is deprecated and will be removed in a future release. Please use STOP REPLICA instead |
| 86 |
Note 3084 Replication thread(s) for channel '' are already stopped. |
| 87 |
CHANGE REPLICATION SOURCE to SOURCE_HOST='127.0.0.1',SOURCE_PORT=MASTER_MYPORT, SOURCE_USER='root'; |
| 88 |
Warnings: |
| 89 |
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. |
| 90 |
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. |
| 91 |
SET @@global.replica_parallel_workers=1; |
| 92 |
set @save_replica_transaction_retries= @@global.replica_transaction_retries; |
| 93 |
start slave; |
| 94 |
Warnings: |
| 95 |
Warning 1287 'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead |
| 96 |
create database d1; |
| 97 |
create table d1.t1(a int); |
| 98 |
insert into d1.t1 values(1); |
| 99 |
# |
| 100 |
# BUG#20513547 REPLICATION_APPLIER_STATUS_BY_WORKER SHOWS |
| 101 |
# WRONG WORKER_ID WHEN SLAVE STOPS |
| 102 |
# |
| 103 |
include/stop_slave.inc |
| 104 |
SET @@GLOBAL.replica_parallel_workers = 3; |
| 105 |
include/start_slave.inc |
| 106 |
SELECT worker_id from performance_schema.replication_applier_status_by_worker; |
| 107 |
worker_id |
| 108 |
1 |
| 109 |
2 |
| 110 |
3 |
| 111 |
include/stop_slave.inc |
| 112 |
SELECT worker_id from performance_schema.replication_applier_status_by_worker; |
| 113 |
worker_id |
| 114 |
1 |
| 115 |
2 |
| 116 |
3 |
| 117 |
|
| 118 |
# Cleanup. |
| 119 |
|
| 120 |
DROP DATABASE d1; |
| 121 |
set @@global.replica_parallel_workers= @save_replica_parallel_workers; |
| 122 |
set @@global.replica_transaction_retries= @save_replica_transaction_retries; |
| 123 |
include/start_slave.inc |
| 124 |
include/rpl_set_gtid_mode.inc [OFF on servers 1,2] |
| 125 |
include/rpl_end.inc |