-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathresume_streaming.test
More file actions
161 lines (134 loc) · 5.85 KB
/
resume_streaming.test
File metadata and controls
161 lines (134 loc) · 5.85 KB
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
--source ../include/have_binsrv.inc
--source ../include/v80_v84_compatibility_defines.inc
# in case of --repeat=N, we need to start from a fresh binary log to make
# this test deterministic
--echo *** Resetting replication at the very beginning of the test.
--disable_query_log
eval $stmt_reset_binary_logs_and_gtids;
--enable_query_log
# identifying backend storage type ('file' or 's3')
--source ../include/identify_storage_backend.inc
# identifying utility buffering mode from the conbination
--let $extracted_init_connect_variable_name = binsrv_buffering_mode
--source ../include/extract_init_connect_variable_value.inc
# creating data directory, configuration file, etc.
--let $binsrv_connect_timeout = 20
--let $binsrv_read_timeout = 60
--let $binsrv_idle_time = 10
--let $binsrv_verify_checksum = TRUE
--let $binsrv_replication_mode = `SELECT IF(@@global.gtid_mode, 'gtid', 'position')`
if ($extracted_init_connect_variable_value == 'buffered')
{
--let $binsrv_checkpoint_size = 1G
}
if ($extracted_init_connect_variable_value == 'unbuffered')
{
--let $binsrv_checkpoint_size = 1
}
--source ../include/set_up_binsrv_environment.inc
--echo
--echo *** 1. Executing the Binlog Server utility to for the very first
--echo *** time on an empty storage and receive no real events.
--exec $BINSRV fetch $binsrv_config_file_path > /dev/null
--echo
--echo *** 1a. Executing the Binlog Server utility on a storage that has
--echo *** only one binlog file that has only magic payload in it and
--echo *** receive no events.
--exec $BINSRV fetch $binsrv_config_file_path > /dev/null
--echo
--echo *** Creating a simple table
CREATE TABLE t1(id INT UNSIGNED NOT NULL AUTO_INCREMENT, PRIMARY KEY(id)) ENGINE=InnoDB;
--echo
--echo *** 2. Executing the Binlog Server utility on a storage that has
--echo *** only one binlog file that has only magic payload in it and
--echo *** receive events from the CREATE TABLE transaction.
--exec $BINSRV fetch $binsrv_config_file_path > /dev/null
--echo
--echo *** 2a. Executing the Binlog Server utility on a storage that has
--echo *** only one binlog file that has CREATE TABLE transaction and
--echo *** receive no events.
--exec $BINSRV fetch $binsrv_config_file_path > /dev/null
--echo
--echo *** Filling the table with some data (one transaction with one
--echo *** insert and another one with two inserts).
INSERT INTO t1 VALUES(DEFAULT);
START TRANSACTION;
INSERT INTO t1 VALUES(DEFAULT);
INSERT INTO t1 VALUES(DEFAULT);
COMMIT;
--echo
--echo *** 3. Executing the Binlog Server utility on a storage that has
--echo *** only one binlog file with some data and receive events from
--echo *** the INSERT transactions.
--exec $BINSRV fetch $binsrv_config_file_path > /dev/null
--echo
--echo *** 3a. Executing the Binlog Server utility on a storage that has
--echo *** only one binlog file with some data and receive no events.
--exec $BINSRV fetch $binsrv_config_file_path > /dev/null
--echo
--echo *** Flushing the first binary log and switching to the second one.
FLUSH BINARY LOGS;
--echo
--echo *** 4. Executing the Binlog Server utility on a storage that has
--echo *** only one binlog file with some data and receive a single
--echo *** ROTATE event.
--exec $BINSRV fetch $binsrv_config_file_path > /dev/null
--echo
--echo *** 4a. Executing the Binlog Server utility on a storage that has
--echo *** one binlog file with some data and another one with just
--echo *** magic payload and receive no events.
--exec $BINSRV fetch $binsrv_config_file_path > /dev/null
--echo
--echo *** Filling the table with some more data (one transaction with one
--echo *** insert and another one with two inserts).
INSERT INTO t1 VALUES(DEFAULT);
START TRANSACTION;
INSERT INTO t1 VALUES(DEFAULT);
INSERT INTO t1 VALUES(DEFAULT);
COMMIT;
--echo
--echo *** 5. Executing the Binlog Server utility on a storage that has
--echo *** one binlog file with some data and another one with just
--echo *** magic payload and receive events from the second group of
--echo *** INSERT transactions.
--exec $BINSRV fetch $binsrv_config_file_path > /dev/null
--echo
--echo *** 5a. Executing the Binlog Server utility on a storage that has
--echo *** two binlog files with some data and receive no events
--exec $BINSRV fetch $binsrv_config_file_path > /dev/null
--echo
--echo *** Flushing the second binary log and switching to the third one.
--echo *** Immediately after that updating data inserted previously.
FLUSH BINARY LOGS;
UPDATE t1 SET id = id + 100;
--echo
--echo *** 6. Executing the Binlog Server utility on a storage that has
--echo *** two binlog files with some data and receive a ROTATE event
--echo *** followed by events from the UPDATE transaction
--exec $BINSRV fetch $binsrv_config_file_path > /dev/null
--echo
--echo *** 6a. Executing the Binlog Server utility on a storage that has
--echo *** three binlog files with some data and receive no events.
--exec $BINSRV fetch $binsrv_config_file_path > /dev/null
--echo
--echo *** Flushing the third binary log and switching to the fourth one.
--echo *** Immediately after that deleting some data updated previously and
--echo *** flushing one more time switching to the fifth binary log file.
FLUSH BINARY LOGS;
DELETE FROM t1 WHERE id <= 103;
FLUSH BINARY LOGS;
--echo
--echo *** 7. Executing the Binlog Server utility on a storage that has
--echo *** three binlog files with some data and receive a ROTATE
--echo *** event followed by a events from the DELETE transaction
--echo *** followed by another ROTATE event
--exec $BINSRV fetch $binsrv_config_file_path > /dev/null
--echo
--echo *** 7a. Executing the Binlog Server utility on a storage that has
--echo *** five binlog files with some data and receive no events.
--exec $BINSRV fetch $binsrv_config_file_path > /dev/null
--echo
--echo *** Dropping the table.
DROP TABLE t1;
# cleaning up
--source ../include/tear_down_binsrv_environment.inc