summaryrefslogtreecommitdiff
path: root/mysql-test/suite/rpl/r/rpl_perfschema_applier_status_by_coordinator.result
blob: ffffb580518cbafbb0a68968bc9af994bb09e7d2 (plain)
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
include/master-slave.inc
[connection master]
call mtr.add_suppression("Error 'Table 'test.t' doesn't exist' on query.");
include/assert.inc [On master, the table should return an empty set.]
connection slave;
include/wait_for_slave_param.inc [Slave_SQL_Running_State]

# Testing on fresh slave.

include/assert.inc [thread_name should should indicate sql thread.]
include/assert.inc [SSS shows Slave_IO_Running as "Yes". So, Service_State from this PS table should be "ON".]
include/assert.inc [Value returned by SSS and PS table for Last_Error_Number should be same.]
include/assert.inc [Value returned by SSS and PS table for Last_Error_Message should be same.]
include/assert.inc [Value returned by SSS and PS table for Last_Error_Timestamp should be 0000-00-00 00:00:00.]
include/assert.inc [Last_trans_retry_count should be 0.]

# Cause an error in the SQL thread and check for the correctness of
# values in error number, message and timestamp fields.

connection master;
use test;
create table t(a int primary key);
include/sync_slave_sql_with_master.inc
drop table t;
connection master;
insert into t values(1);
connection slave;
include/wait_for_slave_sql_error.inc [errno=1146]

# Extract the error related fields from SSS and PS table and compare
# them for correctness.

include/assert.inc [Value returned by SSS and PS table for Last_Error_Number should be same.]
Value returned by SSS and PS table for Last_Error_Message is same.

# Verify that the error fields are preserved after STOP SLAVE, thread_id
# changes to NULL and service_state changes to "Off".


# 1. Verify that thread_id changes to NULL and service_state to "off" on
#    STOP SLAVE.

include/assert.inc [After STOP SLAVE, thread_id should be NULL]
include/assert.inc [SSS shows Slave_SQL_Running as "No". So, Service_State from this PS table should be "OFF".]

# 2. Extract the error related fields from SSS and PS table and compare
#    them. These fields should preserve their values.

include/assert.inc [Value returned by SSS and PS table for Last_Error_Number should be same.]
Value returned by SSS and PS table for Last_Error_Message is same.
connection master;
drop table t;
reset master;
connection slave;
include/stop_slave.inc
reset slave;
reset master;
set @@global.gtid_slave_pos= "";
set @saved_slave_trans_retry_interval= @@GLOBAL.slave_transaction_retry_interval;
set global slave_transaction_retry_interval=1;
include/start_slave.inc
#
# Test Last_Trans_Retry_Count value.
#
connection master;
create table t1 (f int primary key) engine=innodb;
insert into t1 values (10);
connection slave;
connect  slave2,127.0.0.1,root,,test,$SLAVE_MYPORT,;
connection slave2;
begin;
update t1 set f=40 where f=10;
connection master;
begin;
update t1 set f=60 where f=10;
commit;
connection slave;
connection slave2;
rollback;
include/assert.inc [Value returned by PS table for Last_Trans_Retry_Count should be > 0.]
connection master;
drop table t1;
connection slave;
disconnect slave2;
set global slave_transaction_retry_interval=@saved_slave_trans_retry_interval;
include/stop_slave.inc

# Restarting servers and setting up MTS now. Since, SQL thread and
# coordinator are the same and follow same code path, we can skip
# testing for coordinator thread in all scenarios. Testing for one
# scenario is enough.

include/rpl_restart_server.inc [server_number=1]
include/rpl_restart_server.inc [server_number=2]
connection slave;
change master to
master_host='127.0.0.1',
master_port=MASTER_MYPORT,
master_user='root';
SET @save.slave_parallel_workers=@@global.slave_parallel_workers;
SET @@global.slave_parallel_workers=1;
set @save.slave_transaction_retries= @@global.slave_transaction_retries;
include/start_slave.inc
include/wait_for_slave_param.inc [Slave_SQL_Running_State]
include/assert.inc [thread_name should should indicate sql thread.]
include/assert.inc [SSS shows Slave_SQL_Running as "Yes". So, Service_State from this PS table should be "ON".]
include/assert.inc [Value returned by SSS and PS table for Last_Error_Number should be same.]

# Cleanup.

include/stop_slave.inc
set @@global.slave_parallel_workers= @save.slave_parallel_workers;
set @@global.slave_transaction_retries= @save.slave_transaction_retries;
include/start_slave.inc
include/rpl_end.inc