mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Bug#13545447 RPL_ROTATE_LOGS FAILS DUE TO CONCURRENCY ISSUES IN REP. CODE
RPL_ROTATE_LOGS has been failing sporadically in what seems a problem related to routines that update the coordinates. However, the test lacks proper assert statments and because of this the debug information upon failure simply points to the content mismatch between the test and the result file. Not as a solution, but as a improvement to the test to better debug this failure, new assert statments were added to the test. @rpl_rotate_logs.test Added new assert statments reducing the dependency on the result file. @rpl_rotate_logs.result Added new content to the result file to match the test changes
This commit is contained in:
@ -17,10 +17,8 @@ insert into t1 values('Could not break slave'),('Tried hard');
|
|||||||
Master_Log_File = 'master-bin.000001'
|
Master_Log_File = 'master-bin.000001'
|
||||||
Relay_Master_Log_File = 'master-bin.000001'
|
Relay_Master_Log_File = 'master-bin.000001'
|
||||||
include/check_slave_is_running.inc
|
include/check_slave_is_running.inc
|
||||||
select * from t1;
|
include/assert.inc [Table t1 should contain the first inserted line]
|
||||||
s
|
include/assert.inc [Table t1 should contain the second inserted line]
|
||||||
Could not break slave
|
|
||||||
Tried hard
|
|
||||||
flush logs;
|
flush logs;
|
||||||
create table t2(m int not null auto_increment primary key);
|
create table t2(m int not null auto_increment primary key);
|
||||||
insert into t2 values (34),(67),(123);
|
insert into t2 values (34),(67),(123);
|
||||||
@ -31,9 +29,7 @@ master-bin.000001 #
|
|||||||
master-bin.000002 #
|
master-bin.000002 #
|
||||||
master-bin.000003 #
|
master-bin.000003 #
|
||||||
create table t3 select * from temp_table;
|
create table t3 select * from temp_table;
|
||||||
select * from t3;
|
include/assert.inc [Data in t3 should be equal to temp_table]
|
||||||
a
|
|
||||||
testing temporary tables
|
|
||||||
drop table temp_table, t3;
|
drop table temp_table, t3;
|
||||||
insert into t2 values(1234);
|
insert into t2 values(1234);
|
||||||
set insert_id=1234;
|
set insert_id=1234;
|
||||||
@ -60,19 +56,15 @@ insert into t2 values (65);
|
|||||||
Master_Log_File = 'master-bin.000003'
|
Master_Log_File = 'master-bin.000003'
|
||||||
Relay_Master_Log_File = 'master-bin.000003'
|
Relay_Master_Log_File = 'master-bin.000003'
|
||||||
include/check_slave_is_running.inc
|
include/check_slave_is_running.inc
|
||||||
select * from t2;
|
include/assert.inc [Table t2 should still contain the first inserted line after creation]
|
||||||
m
|
include/assert.inc [Table t2 should contain the line inserted after the purge]
|
||||||
34
|
include/assert.inc [Table t2 should still contain the second insert line after creation]
|
||||||
65
|
include/assert.inc [Table t2 should still contain the third inserted line after creation]
|
||||||
67
|
include/assert.inc [Table t2 should still contain the line from the duplicated key test]
|
||||||
123
|
|
||||||
1234
|
|
||||||
create temporary table temp_table (a char(80) not null);
|
create temporary table temp_table (a char(80) not null);
|
||||||
insert into temp_table values ("testing temporary tables part 2");
|
insert into temp_table values ("testing temporary tables part 2");
|
||||||
create table t3 (n int);
|
create table t3 (n int);
|
||||||
select count(*) from t3 where n >= 4;
|
include/assert.inc [Table t3 should contain 100 lines on the master]
|
||||||
count(*)
|
|
||||||
100
|
|
||||||
create table t4 select * from temp_table;
|
create table t4 select * from temp_table;
|
||||||
show binary logs;
|
show binary logs;
|
||||||
Log_name File_size
|
Log_name File_size
|
||||||
@ -85,16 +77,12 @@ master-bin.000008 #
|
|||||||
show master status;
|
show master status;
|
||||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||||
master-bin.000008 # <Binlog_Do_DB> <Binlog_Ignore_DB>
|
master-bin.000008 # <Binlog_Do_DB> <Binlog_Ignore_DB>
|
||||||
select * from t4;
|
include/assert.inc [Data in t4 should be equal to temp_table]
|
||||||
a
|
|
||||||
testing temporary tables part 2
|
|
||||||
Master_Log_File = 'master-bin.000008'
|
Master_Log_File = 'master-bin.000008'
|
||||||
Relay_Master_Log_File = 'master-bin.000008'
|
Relay_Master_Log_File = 'master-bin.000008'
|
||||||
include/check_slave_is_running.inc
|
include/check_slave_is_running.inc
|
||||||
lock tables t3 read;
|
lock tables t3 read;
|
||||||
select count(*) from t3 where n >= 4;
|
include/assert.inc [Table t3 should contain 100 lines on the slave]
|
||||||
count(*)
|
|
||||||
100
|
|
||||||
unlock tables;
|
unlock tables;
|
||||||
drop table if exists t1,t2,t3,t4;
|
drop table if exists t1,t2,t3,t4;
|
||||||
End of 4.1 tests
|
End of 4.1 tests
|
||||||
|
@ -66,7 +66,17 @@ sync_slave_with_master;
|
|||||||
let $status_items= Master_Log_File, Relay_Master_Log_File;
|
let $status_items= Master_Log_File, Relay_Master_Log_File;
|
||||||
source include/show_slave_status.inc;
|
source include/show_slave_status.inc;
|
||||||
source include/check_slave_is_running.inc;
|
source include/check_slave_is_running.inc;
|
||||||
select * from t1;
|
|
||||||
|
--let $assert_text= Table t1 should contain the first inserted line
|
||||||
|
--let $query_result= query_get_value(select * from t1, "s", 1)
|
||||||
|
--let $assert_cond= "$query_result" = "Could not break slave"
|
||||||
|
--source include/assert.inc
|
||||||
|
|
||||||
|
--let $assert_text= Table t1 should contain the second inserted line
|
||||||
|
--let $query_result= query_get_value(select * from t1, "s", 2)
|
||||||
|
--let $assert_cond= "$query_result" = "Tried hard"
|
||||||
|
--source include/assert.inc
|
||||||
|
|
||||||
connection master;
|
connection master;
|
||||||
flush logs;
|
flush logs;
|
||||||
create table t2(m int not null auto_increment primary key);
|
create table t2(m int not null auto_increment primary key);
|
||||||
@ -77,7 +87,11 @@ create table t3 select * from temp_table;
|
|||||||
|
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
|
|
||||||
select * from t3;
|
--let $query_result= query_get_value(select * from t3, "a", 1)
|
||||||
|
--let $assert_text= Data in t3 should be equal to temp_table
|
||||||
|
--let $assert_cond= "$query_result" = "testing temporary tables"
|
||||||
|
--source include/assert.inc
|
||||||
|
|
||||||
connection master;
|
connection master;
|
||||||
drop table temp_table, t3;
|
drop table temp_table, t3;
|
||||||
|
|
||||||
@ -136,11 +150,30 @@ insert into t2 values (65);
|
|||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
source include/show_slave_status.inc;
|
source include/show_slave_status.inc;
|
||||||
source include/check_slave_is_running.inc;
|
source include/check_slave_is_running.inc;
|
||||||
select * from t2;
|
|
||||||
|
--let $assert_text= Table t2 should still contain the first inserted line after creation
|
||||||
|
--let $assert_cond= [select * from t2,"m",1] = 34
|
||||||
|
--source include/assert.inc
|
||||||
|
|
||||||
|
--let $assert_text= Table t2 should contain the line inserted after the purge
|
||||||
|
--let $assert_cond= [select * from t2,"m",2] = 65
|
||||||
|
--source include/assert.inc
|
||||||
|
|
||||||
|
--let $assert_text= Table t2 should still contain the second insert line after creation
|
||||||
|
--let $assert_cond= [select * from t2,"m",3] = 67
|
||||||
|
--source include/assert.inc
|
||||||
|
|
||||||
|
--let $assert_text= Table t2 should still contain the third inserted line after creation
|
||||||
|
--let $assert_cond= [select * from t2,"m",4] = 123
|
||||||
|
--source include/assert.inc
|
||||||
|
|
||||||
|
--let $assert_text= Table t2 should still contain the line from the duplicated key test
|
||||||
|
--let $assert_cond= [select * from t2,"m",5] = 1234
|
||||||
|
--source include/assert.inc
|
||||||
|
|
||||||
#
|
#
|
||||||
# Test forcing the replication log to rotate
|
# Test forcing the replication log to rotate
|
||||||
#
|
#
|
||||||
|
|
||||||
connection master;
|
connection master;
|
||||||
create temporary table temp_table (a char(80) not null);
|
create temporary table temp_table (a char(80) not null);
|
||||||
@ -156,19 +189,31 @@ while ($1)
|
|||||||
dec $1;
|
dec $1;
|
||||||
}
|
}
|
||||||
enable_query_log;
|
enable_query_log;
|
||||||
select count(*) from t3 where n >= 4;
|
|
||||||
|
--let $assert_text= Table t3 should contain 100 lines on the master
|
||||||
|
--let $assert_cond= [select count(*) from t3 where n >= 4,"count(*)",1] = 100
|
||||||
|
--source include/assert.inc
|
||||||
|
|
||||||
create table t4 select * from temp_table;
|
create table t4 select * from temp_table;
|
||||||
source include/show_binary_logs.inc;
|
source include/show_binary_logs.inc;
|
||||||
source include/show_master_status.inc;
|
source include/show_master_status.inc;
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
select * from t4;
|
|
||||||
|
--let $query_result= query_get_value(select * from t4, "a", 1)
|
||||||
|
--let $assert_text= Data in t4 should be equal to temp_table
|
||||||
|
--let $assert_cond= "$query_result" = "testing temporary tables part 2"
|
||||||
|
--source include/assert.inc
|
||||||
|
|
||||||
source include/show_slave_status.inc;
|
source include/show_slave_status.inc;
|
||||||
source include/check_slave_is_running.inc;
|
source include/check_slave_is_running.inc;
|
||||||
# because of concurrent insert, the table may not be up to date
|
# because of concurrent insert, the table may not be up to date
|
||||||
# if we do not lock
|
# if we do not lock
|
||||||
lock tables t3 read;
|
lock tables t3 read;
|
||||||
select count(*) from t3 where n >= 4;
|
|
||||||
|
--let $assert_text= Table t3 should contain 100 lines on the slave
|
||||||
|
--let $assert_cond= [select count(*) from t3 where n >= 4,"count(*)",1] = 100
|
||||||
|
--source include/assert.inc
|
||||||
|
|
||||||
unlock tables;
|
unlock tables;
|
||||||
#clean up
|
#clean up
|
||||||
connection master;
|
connection master;
|
||||||
|
Reference in New Issue
Block a user