File: master_last_event_time_row.result

package info (click to toggle)
mariadb 1%3A11.8.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 772,520 kB
  • sloc: ansic: 2,414,714; cpp: 1,791,394; asm: 381,336; perl: 62,905; sh: 49,647; pascal: 40,897; java: 39,363; python: 20,791; yacc: 20,432; sql: 17,907; xml: 12,344; ruby: 8,544; cs: 6,542; makefile: 6,145; ada: 1,879; lex: 1,193; javascript: 996; objc: 80; tcl: 73; awk: 46; php: 22
file content (215 lines) | stat: -rw-r--r-- 5,766 bytes parent folder | download | duplicates (2)
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
include/rpl_init.inc [topology=1->2->3]
#
# Initialize test data
# Ensure that all slaves has master_last_event_time == NULL
#
connection server_1;
SET STATEMENT sql_log_bin=0 FOR create table t1 (a int) engine=innodb;
include/save_master_pos.inc
connection server_2;
SET STATEMENT sql_log_bin=0 FOR create table t1 (a int) engine=innodb;
connection server_3;
SET STATEMENT sql_log_bin=0 FOR create table t1 (a int) engine=innodb;
#
# Test *_last_event_time is updated at proper place.
# Master_last_event_time should be updated by the IO thread when reading
# in a new transaction from the primary.
# Slave_last_event_time should be updated by the SQL thread
#   1) immediately upon seeing the first transaction if the replica is
#      starting fresh, or
#   2) after committing a transaction.
#
connection server_2;
start slave io_thread;
include/sync_io_with_master.inc
master_time:  (should be empty)
slave_time:  (should be empty)
# Sleep 2s to create a time gap between the header events (i.e.
# Format_description and Gtid_list) and the transaction event to allow
# proving that header events should not update
# (Master|Slave)_last_event_time
connect  server_1_1,127.0.0.1,root,,test,$SERVER_MYPORT_1,;
set @@timestamp= TIMESTAMP;
insert into t1 values (0);
include/save_master_pos.inc
connection server_2;
include/sync_io_with_master.inc
# For the first event, at execution start, Slave_last_event_time should
# be updated to be 1 second prior to the time that the first transaction
# was binlogged on the primary. This is to represent that the slave is
# otherwise up-to-date. Note the table is locked to prevent the
# transaction from committing (and thereby progressing
# Slave_last_event_time to represent commit-time).
connect  server_2_2,127.0.0.1,root,,test,$SERVER_MYPORT_2,;
lock tables t1 write;
connection server_2;
start slave sql_thread;
# Waiting for replica to start executing the transaction (yet get stuck on the table lock)
connection server_2_2;
unlock tables;
connection server_2;
include/wait_for_slave_param.inc [Relay_Master_Log_File]
include/wait_for_slave_param.inc [Exec_Master_Log_Pos]
#
# Test that changes are properly applied by server_2 and server_3
#
connection server_1;
include/save_master_pos.inc
connection server_2;
include/wait_for_slave_param.inc [Relay_Master_Log_File]
include/wait_for_slave_param.inc [Exec_Master_Log_Pos]
include/save_master_pos.inc
# Show that the server_2 received the insert from master
select * from t1;
a
0
master <> NULL; Should be 1
1
master_time == slave_time ; Should be 1
1
connection server_3;
include/start_slave.inc
include/wait_for_slave_param.inc [Relay_Master_Log_File]
include/wait_for_slave_param.inc [Exec_Master_Log_Pos]
# Show that the server_3 received the insert from master
select * from t1;
a
0
master <> NULL; Should be 1
1
master_time == slave_time ; Should be 1
1
include/stop_slave.inc
connection server_1;
#
# Test simple insert
#
connection server_1;
insert into t1 values (1+sleep(3));
#
# Test that changes are properly applied by server_2 and server_3
#
connection server_1;
include/save_master_pos.inc
connection server_2;
include/wait_for_slave_param.inc [Relay_Master_Log_File]
include/wait_for_slave_param.inc [Exec_Master_Log_Pos]
include/save_master_pos.inc
# Show that the server_2 received the insert from master
select * from t1;
a
0
1
master <> NULL; Should be 1
1
master_time == slave_time ; Should be 1
1
connection server_3;
include/start_slave.inc
include/wait_for_slave_param.inc [Relay_Master_Log_File]
include/wait_for_slave_param.inc [Exec_Master_Log_Pos]
# Show that the server_3 received the insert from master
select * from t1;
a
0
1
master <> NULL; Should be 1
1
master_time == slave_time ; Should be 1
1
include/stop_slave.inc
connection server_1;
#
# Test insert with forced time
#
SET TIMESTAMP=unix_timestamp("2000-01-01");
insert into t1 values (2+sleep(3));
SET TIMESTAMP=DEFAULT;
#
# Test that changes are properly applied by server_2 and server_3
#
connection server_1;
include/save_master_pos.inc
connection server_2;
include/wait_for_slave_param.inc [Relay_Master_Log_File]
include/wait_for_slave_param.inc [Exec_Master_Log_Pos]
include/save_master_pos.inc
# Show that the server_2 received the insert from master
select * from t1;
a
0
1
2
master <> NULL; Should be 1
1
master_time == slave_time ; Should be 1
1
connection server_3;
include/start_slave.inc
include/wait_for_slave_param.inc [Relay_Master_Log_File]
include/wait_for_slave_param.inc [Exec_Master_Log_Pos]
# Show that the server_3 received the insert from master
select * from t1;
a
0
1
2
master <> NULL; Should be 1
1
master_time == slave_time ; Should be 1
1
include/stop_slave.inc
connection server_1;
#
# Test multi-transaction
#
begin;
insert into t1 values (3+sleep(3));
insert into t1 values (4+sleep(3));
commit;
#
# Test that changes are properly applied by server_2 and server_3
#
connection server_1;
include/save_master_pos.inc
connection server_2;
include/wait_for_slave_param.inc [Relay_Master_Log_File]
include/wait_for_slave_param.inc [Exec_Master_Log_Pos]
include/save_master_pos.inc
# Show that the server_2 received the insert from master
select * from t1;
a
0
1
2
3
4
master <> NULL; Should be 1
1
master_time == slave_time ; Should be 1
1
connection server_3;
include/start_slave.inc
include/wait_for_slave_param.inc [Relay_Master_Log_File]
include/wait_for_slave_param.inc [Exec_Master_Log_Pos]
# Show that the server_3 received the insert from master
select * from t1;
a
0
1
2
3
4
master <> NULL; Should be 1
1
master_time == slave_time ; Should be 1
1
include/stop_slave.inc
connection server_1;
# cleanup
connection server_3;
include/start_slave.inc
connection server_1;
drop table t1;
include/rpl_end.inc
# End of master_last_event_time_row