mirror of
https://github.com/MariaDB/server.git
synced 2025-08-27 13:04:36 +03:00
Major replication test framework cleanup. This does the following: - Ensure that all tests clean up the replication state when they finish, by making check-testcase check the output of SHOW SLAVE STATUS. This implies: - Slave must not be running after test finished. This is good because it removes the risk for sporadic errors in subsequent tests when a test forgets to sync correctly. - Slave SQL and IO errors must be cleared when test ends. This is good because we will notice if a test gets an unexpected error in the slave threads near the end. - We no longer have to clean up before a test starts. - Ensure that all tests that wait for an error in one of the slave threads waits for a specific error. It is no longer possible to source wait_for_slave_[sql|io]_to_stop.inc when there is an error in one of the slave threads. This is good because: - If a test expects an error but there is a bug that causes another error to happen, or if it stops the slave thread without an error, then we will notice. - When developing tests, wait_for_*_to_[start|stop].inc will fail immediately if there is an error in the relevant slave thread. Before this patch, we had to wait for the timeout. - Remove duplicated and repeated code for setting up unusual replication topologies. Now, there is a single file that is capable of setting up arbitrary topologies (include/rpl_init.inc, but include/master-slave.inc is still available for the most common topology). Tests can now end with include/rpl_end.inc, which will clean up correctly no matter what topology is used. The topology can be changed with include/rpl_change_topology.inc. - Improved debug information when tests fail. This includes: - debug info is printed on all servers configured by include/rpl_init.inc - User can set $rpl_debug=1, which makes auxiliary replication files print relevant debug info. - Improved documentation for all auxiliary replication files. Now they describe purpose, usage, parameters, and side effects. - Many small code cleanups: - Made have_innodb.inc output a sensible error message. - Moved contents of rpl000017-slave.sh into rpl000017.test - Added mysqltest variables that expose the current state of disable_warnings/enable_warnings and friends. - Too many to list here: see per-file comments for details.
133 lines
6.5 KiB
Plaintext
133 lines
6.5 KiB
Plaintext
include/master-slave.inc
|
|
[connection master]
|
|
create table t1 (
|
|
a int not null primary key,
|
|
b text not null
|
|
) engine=ndb;
|
|
insert into t1 values(1, repeat('abc',10));
|
|
insert into t1 values(2, repeat('def',200));
|
|
insert into t1 values(3, repeat('ghi',3000));
|
|
select 'M', a, sha1(b) from t1
|
|
order by a;
|
|
M a sha1(b)
|
|
M 1 8a6c4cf7cf97e66c487c3e3b717e9ae13623d07d
|
|
M 2 0ccd08c0fa6ad6a4382b27b1d36586d6ceb4fffa
|
|
M 3 75e7b3299e0b776aeac2a4d1542d5b3c0ba2e05e
|
|
select 'S', a, sha1(b) from t1
|
|
order by a;
|
|
S a sha1(b)
|
|
S 1 8a6c4cf7cf97e66c487c3e3b717e9ae13623d07d
|
|
S 2 0ccd08c0fa6ad6a4382b27b1d36586d6ceb4fffa
|
|
S 3 75e7b3299e0b776aeac2a4d1542d5b3c0ba2e05e
|
|
drop table t1;
|
|
create table t1 (
|
|
a int not null primary key,
|
|
b text not null,
|
|
c int,
|
|
d longblob,
|
|
e tinyblob
|
|
) engine=ndbcluster;
|
|
insert into t1 values (
|
|
0, repeat(@s2,454), 100, repeat(@s2,345), NULL);
|
|
insert into t1 values (
|
|
1, repeat(@s0,504), NULL, repeat(@s1,732), repeat(@s1,1));
|
|
insert into t1 values (
|
|
2, '', 102, '', repeat(@s2,1));
|
|
insert into t1 values (
|
|
3, repeat(@s0,545), 103, repeat(@s2,788), repeat(@s0,1));
|
|
insert into t1 values (
|
|
4, repeat(@s1,38), 104, repeat(@s0,260), repeat(@s0,1));
|
|
insert into t1 values (
|
|
5, repeat(@s2,12), 105, repeat(@s2,40), repeat(@s1,1));
|
|
insert into t1 values (
|
|
6, repeat(@s1,242), 106, NULL, repeat(@s1,1));
|
|
insert into t1 values (
|
|
7, repeat(@s1,30), 107, repeat(@s0,161), '');
|
|
insert into t1 values (
|
|
8, repeat(@s1,719), 108, repeat(@s2,104), NULL);
|
|
insert into t1 values (
|
|
9, repeat(@s2,427), NULL, NULL, NULL);
|
|
select 'M', a, sha1(b), c, sha1(d), sha1(e)
|
|
from t1 order by a;
|
|
M a sha1(b) c sha1(d) sha1(e)
|
|
M 0 9538f61e649383c0d1054de2a2f0171188129f33 100 2b6515f29c20b8e9e17cc597527e516c0de8d612 NULL
|
|
M 1 dcb9a12ca86e718ff2564be041b7c1b3ff5ea559 NULL f23e7439d9a73c3954979b85a7ef6ef35faf4e9d abfe8ae5212b22d023aa6de84beeb1344ac5668a
|
|
M 2 da39a3ee5e6b4b0d3255bfef95601890afd80709 102 da39a3ee5e6b4b0d3255bfef95601890afd80709 33deebe47470a40e960834bffa4cdc66790845a6
|
|
M 3 ec8e06d9ac4695d6a898b519ba840590263a9bff 103 278629ad080c3c4377978c006c2e54d0992e43cc 700915801f853603510aeb67b331866d996fdbda
|
|
M 4 0392fa8c425d293c79291f0f34779d1101d13fcb 104 5084b602c7203e0e9590a163415ac605da17ac32 700915801f853603510aeb67b331866d996fdbda
|
|
M 5 0f9653f0c7a69cd1c617792d546582e974a7a24d 105 566588a04ff26d05160d61c83435292bfda2978e abfe8ae5212b22d023aa6de84beeb1344ac5668a
|
|
M 6 a37e8b0ff4fc13a42be02cdecb36186436959bae 106 NULL abfe8ae5212b22d023aa6de84beeb1344ac5668a
|
|
M 7 a6bae0cfe6b45ff8c3c12d2ce577a1cd3931190f 107 39ee712b4b9e47f2cf3ba7c9790b2bf0d8f378e8 da39a3ee5e6b4b0d3255bfef95601890afd80709
|
|
M 8 e139adcb7b2974ee7ff227fd405709e5cb7c896c 108 ba8073b0e1a281d4111bd2d82c7722b01574c00b NULL
|
|
M 9 1fc5168fe4be566b17b658d94e7813f0b5032cdb NULL NULL NULL
|
|
select 'S', a, sha1(b), c, sha1(d), sha1(e)
|
|
from t1 order by a;
|
|
S a sha1(b) c sha1(d) sha1(e)
|
|
S 0 9538f61e649383c0d1054de2a2f0171188129f33 100 2b6515f29c20b8e9e17cc597527e516c0de8d612 NULL
|
|
S 1 dcb9a12ca86e718ff2564be041b7c1b3ff5ea559 NULL f23e7439d9a73c3954979b85a7ef6ef35faf4e9d abfe8ae5212b22d023aa6de84beeb1344ac5668a
|
|
S 2 da39a3ee5e6b4b0d3255bfef95601890afd80709 102 da39a3ee5e6b4b0d3255bfef95601890afd80709 33deebe47470a40e960834bffa4cdc66790845a6
|
|
S 3 ec8e06d9ac4695d6a898b519ba840590263a9bff 103 278629ad080c3c4377978c006c2e54d0992e43cc 700915801f853603510aeb67b331866d996fdbda
|
|
S 4 0392fa8c425d293c79291f0f34779d1101d13fcb 104 5084b602c7203e0e9590a163415ac605da17ac32 700915801f853603510aeb67b331866d996fdbda
|
|
S 5 0f9653f0c7a69cd1c617792d546582e974a7a24d 105 566588a04ff26d05160d61c83435292bfda2978e abfe8ae5212b22d023aa6de84beeb1344ac5668a
|
|
S 6 a37e8b0ff4fc13a42be02cdecb36186436959bae 106 NULL abfe8ae5212b22d023aa6de84beeb1344ac5668a
|
|
S 7 a6bae0cfe6b45ff8c3c12d2ce577a1cd3931190f 107 39ee712b4b9e47f2cf3ba7c9790b2bf0d8f378e8 da39a3ee5e6b4b0d3255bfef95601890afd80709
|
|
S 8 e139adcb7b2974ee7ff227fd405709e5cb7c896c 108 ba8073b0e1a281d4111bd2d82c7722b01574c00b NULL
|
|
S 9 1fc5168fe4be566b17b658d94e7813f0b5032cdb NULL NULL NULL
|
|
drop table t1;
|
|
CREATE TABLE IF NOT EXISTS t1 (
|
|
db VARBINARY(63) NOT NULL,
|
|
name VARBINARY(63) NOT NULL,
|
|
slock BINARY(32) NOT NULL,
|
|
query BLOB NOT NULL,
|
|
node_id INT UNSIGNED NOT NULL,
|
|
epoch BIGINT UNSIGNED NOT NULL,
|
|
id INT UNSIGNED NOT NULL,
|
|
version INT UNSIGNED NOT NULL,
|
|
type INT UNSIGNED NOT NULL,
|
|
PRIMARY KEY USING HASH (db,name))
|
|
ENGINE=NDB;
|
|
insert into t1 values ('test','t1',
|
|
'abc',repeat(@s0,10), 11,12,13,14,15);
|
|
insert into t1 values ('test','t2',
|
|
'def',repeat(@s1,100), 21,22,23,24,25);
|
|
insert into t1 values ('test','t3',
|
|
'ghi',repeat(@s2,1000),31,32,33,34,35);
|
|
insert into t1 values ('testtttttttttt','t1',
|
|
'abc',repeat(@s0,10), 11,12,13,14,15);
|
|
insert into t1 values ('testttttttttttt','t1',
|
|
'def',repeat(@s1,100), 21,22,23,24,25);
|
|
insert into t1 values ('testtttttttttttt','t1',
|
|
'ghi',repeat(@s2,1000),31,32,33,34,35);
|
|
insert into t1 values ('t','t11111111111',
|
|
'abc',repeat(@s0,10), 11,12,13,14,15);
|
|
insert into t1 values ('t','t111111111111',
|
|
'def',repeat(@s1,100), 21,22,23,24,25);
|
|
insert into t1 values ('t','t1111111111111',
|
|
'ghi',repeat(@s2,1000),31,32,33,34,35);
|
|
select 'M', db, name, sha1(query), node_id, epoch, id, version, type
|
|
from t1 order by db, name;
|
|
M db name sha1(query) node_id epoch id version type
|
|
M t t11111111111 8fc937d303ee7e4795c0b964d4066cedd6d74cfd 11 12 13 14 15
|
|
M t t111111111111 a5229e9f8977bc99afc3b3627c56f083e97e01bd 21 22 23 24 25
|
|
M t t1111111111111 0820e6ad3eeb06ea60e5e04d0bfe36f286b91098 31 32 33 34 35
|
|
M test t1 8fc937d303ee7e4795c0b964d4066cedd6d74cfd 11 12 13 14 15
|
|
M test t2 a5229e9f8977bc99afc3b3627c56f083e97e01bd 21 22 23 24 25
|
|
M test t3 0820e6ad3eeb06ea60e5e04d0bfe36f286b91098 31 32 33 34 35
|
|
M testtttttttttt t1 8fc937d303ee7e4795c0b964d4066cedd6d74cfd 11 12 13 14 15
|
|
M testttttttttttt t1 a5229e9f8977bc99afc3b3627c56f083e97e01bd 21 22 23 24 25
|
|
M testtttttttttttt t1 0820e6ad3eeb06ea60e5e04d0bfe36f286b91098 31 32 33 34 35
|
|
select 'S', db, name, sha1(query), node_id, epoch, id, version, type
|
|
from t1 order by db, name;
|
|
S db name sha1(query) node_id epoch id version type
|
|
S t t11111111111 8fc937d303ee7e4795c0b964d4066cedd6d74cfd 11 12 13 14 15
|
|
S t t111111111111 a5229e9f8977bc99afc3b3627c56f083e97e01bd 21 22 23 24 25
|
|
S t t1111111111111 0820e6ad3eeb06ea60e5e04d0bfe36f286b91098 31 32 33 34 35
|
|
S test t1 8fc937d303ee7e4795c0b964d4066cedd6d74cfd 11 12 13 14 15
|
|
S test t2 a5229e9f8977bc99afc3b3627c56f083e97e01bd 21 22 23 24 25
|
|
S test t3 0820e6ad3eeb06ea60e5e04d0bfe36f286b91098 31 32 33 34 35
|
|
S testtttttttttt t1 8fc937d303ee7e4795c0b964d4066cedd6d74cfd 11 12 13 14 15
|
|
S testttttttttttt t1 a5229e9f8977bc99afc3b3627c56f083e97e01bd 21 22 23 24 25
|
|
S testtttttttttttt t1 0820e6ad3eeb06ea60e5e04d0bfe36f286b91098 31 32 33 34 35
|
|
drop table t1;
|
|
include/rpl_end.inc
|