mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-16239 Many test in rpl suite fails
Fix rpl_skip_error test. We cant reset Slave_skipped_errors(even with FLUSH STATUS), So instead of absolute slave_skipped_errors we look for delta of slave_skipped_errors Fix rpl.rpl_binlog_errors and binlog_encryption.rpl_binlog_errors We create the $load_file and $load_file2 but we never remove them. Fix rpl_000011.test Instead of real value use delta value , Since flush status wont flush LONGLONG variable. Fix rpl_row_find_row_debug Instead of searching whole log_error_ file we will use search_pattern_in_file which runs pattern search only on latest test run , instead of full file. Fix rpl_ip_mix rpl_ip_mix2 We should call reset slave all because we also want to reset master_host otherwise show slave status wont be empty and making repeat N a failure. Fix rpl_rotate_logs First we have to remove master.info file (cleanup) and second we have to call reset slave all because if we do not call reset slave all then we wont read master.info file beacuse we already have master config in memory. And this makes start slave to pass , which shoud fail becuase its permision is 000 Fix circular_serverid0 test The reason is that ++dbug_rows_event_count == 2 in queue_event does not take --repeat into account. So I have reseted the dbug_rows_event_count in if body.
This commit is contained in:
@ -431,5 +431,7 @@ call mtr.add_suppression("Can't generate a unique log-filename .*");
|
||||
-- source include/stop_slave_sql.inc
|
||||
RESET SLAVE;
|
||||
RESET MASTER;
|
||||
--remove_file $load_file
|
||||
--remove_file $load_file2
|
||||
--let $rpl_only_running_threads= 1
|
||||
--source include/rpl_end.inc
|
||||
|
@ -1,15 +1,13 @@
|
||||
include/master-slave.inc
|
||||
[connection master]
|
||||
connection slave;
|
||||
connection master;
|
||||
create table t1 (n int);
|
||||
insert into t1 values(1);
|
||||
connection slave;
|
||||
show global status like 'com_insert';
|
||||
Variable_name Value
|
||||
Com_insert 1
|
||||
# Com_insert = 1
|
||||
stop slave;
|
||||
show global status like 'com_insert';
|
||||
Variable_name Value
|
||||
Com_insert 1
|
||||
# Com_insert = 1
|
||||
include/wait_for_slave_to_stop.inc
|
||||
start slave;
|
||||
include/wait_for_slave_to_start.inc
|
||||
|
@ -64,3 +64,5 @@ Master-Host: 127.0.0.1
|
||||
change master to master_host='0:0:0:0:0:0:0:1';
|
||||
Master-Host: 0:0:0:0:0:0:0:1
|
||||
CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root';
|
||||
connection slave;
|
||||
reset slave all;
|
||||
|
@ -64,3 +64,5 @@ Master-Host: 127.0.0.1
|
||||
change master to master_host='0:0:0:0:0:0:0:1';
|
||||
Master-Host: 0:0:0:0:0:0:0:1
|
||||
CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root';
|
||||
connection slave;
|
||||
reset slave all;
|
||||
|
@ -128,4 +128,6 @@ show binlog events in '';
|
||||
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
|
||||
purge master logs before now();
|
||||
End of 5.0 tests
|
||||
#cleanup
|
||||
include/stop_slave.inc
|
||||
reset slave all;
|
||||
|
@ -15,7 +15,8 @@ DELETE FROM t1;
|
||||
DROP TABLE t1;
|
||||
connection slave;
|
||||
# Check if any note related to long DELETE_ROWS and UPDATE_ROWS appears in the error log
|
||||
Occurrences: update=1, delete=1
|
||||
FOUND 1 /The slave is applying a ROW event on behalf of an UPDATE statement on table t1 and is currently taking a considerable amount/ in mysqld.2.err
|
||||
FOUND 1 /The slave is applying a ROW event on behalf of a DELETE statement on table t1 and is currently taking a considerable amount/ in mysqld.2.err
|
||||
include/stop_slave.inc
|
||||
SET GLOBAL debug_dbug = '';
|
||||
SET GLOBAL log_warnings = 2;
|
||||
|
@ -1,5 +1,7 @@
|
||||
include/master-slave.inc
|
||||
[connection master]
|
||||
connection slave;
|
||||
connection master;
|
||||
==== Test Without sql_mode=strict_trans_tables ====
|
||||
create table t1 (n int not null primary key);
|
||||
connection slave;
|
||||
@ -105,9 +107,7 @@ t2 CREATE TABLE `t2` (
|
||||
`data` int(11) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
show global status like 'slave_skipped_errors';
|
||||
Variable_name Value
|
||||
Slave_skipped_errors 4
|
||||
# Slave_skipped_errros = 4
|
||||
connection master;
|
||||
INSERT INTO t2 VALUES(1, 1);
|
||||
INSERT INTO t2 VALUES(2, 1);
|
||||
@ -119,9 +119,7 @@ SET SQL_LOG_BIN=1;
|
||||
UPDATE t2 SET id= id + 3, data = 2;
|
||||
connection slave;
|
||||
|
||||
show global status like 'slave_skipped_errors';
|
||||
Variable_name Value
|
||||
Slave_skipped_errors 5
|
||||
# Slave_skipped_errros = 5
|
||||
**** We cannot execute a select as there are differences in the
|
||||
**** behavior between STMT and RBR.
|
||||
==== Clean Up ====
|
||||
|
@ -5,19 +5,19 @@
|
||||
#
|
||||
|
||||
source include/master-slave.inc;
|
||||
|
||||
--connection slave
|
||||
let $initial_com_insert= query_get_value(show global status like "Com_insert", Value, 1);
|
||||
--connection master
|
||||
create table t1 (n int);
|
||||
insert into t1 values(1);
|
||||
sync_slave_with_master;
|
||||
show global status like 'com_insert';
|
||||
let $current_com_insert= query_get_value(show global status like "Com_insert", Value, 1);
|
||||
--let $delta_com_insert= `select $current_com_insert - $initial_com_insert from dual`
|
||||
--echo # Com_insert = $delta_com_insert
|
||||
stop slave;
|
||||
# Temporary work-around for bug MDEV-8301. There is a small window during
|
||||
# thread exit where the local status values of a thread are counted twice
|
||||
# in the global status. Remove this wait_condition.inc once MDEV-8301 is
|
||||
# fixed.
|
||||
--let $wait_condition= SELECT variable_value=1 FROM information_schema.global_status WHERE variable_name="Com_insert";
|
||||
--source include/wait_condition.inc
|
||||
show global status like 'com_insert';
|
||||
let $current_com_insert= query_get_value(show global status like "Com_insert", Value, 1);
|
||||
--let $delta_com_insert= `select $current_com_insert - $initial_com_insert from dual`
|
||||
--echo # Com_insert = $delta_com_insert
|
||||
--source include/wait_for_slave_to_stop.inc
|
||||
start slave;
|
||||
--source include/wait_for_slave_to_start.inc
|
||||
|
@ -44,3 +44,5 @@ let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
|
||||
|
||||
# clean up
|
||||
CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root';
|
||||
--connection slave
|
||||
reset slave all;
|
||||
|
@ -45,3 +45,5 @@ let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
|
||||
|
||||
# clean up
|
||||
CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root';
|
||||
connection slave;
|
||||
reset slave all;
|
||||
|
@ -193,4 +193,8 @@ show binlog events in '';
|
||||
purge master logs before now();
|
||||
|
||||
--echo End of 5.0 tests
|
||||
--echo #cleanup
|
||||
|
||||
--remove_file $MYSQLD_SLAVE_DATADIR/master.info
|
||||
--source include/stop_slave.inc
|
||||
reset slave all;
|
||||
|
@ -42,16 +42,11 @@ DROP TABLE t1;
|
||||
--sync_slave_with_master
|
||||
|
||||
--echo # Check if any note related to long DELETE_ROWS and UPDATE_ROWS appears in the error log
|
||||
perl;
|
||||
use strict;
|
||||
my $log_error= $ENV{'LOG_ERROR'} or die "LOG_ERROR not set";
|
||||
open(FILE, "$log_error") or die("Unable to open $log_error: $!\n");
|
||||
my $upd_count = () = grep(/The slave is applying a ROW event on behalf of an UPDATE statement on table t1 and is currently taking a considerable amount/g,<FILE>);
|
||||
seek(FILE, 0, 0) or die "Can't seek to beginning of file: $!";
|
||||
my $del_count = () = grep(/The slave is applying a ROW event on behalf of a DELETE statement on table t1 and is currently taking a considerable amount/g,<FILE>);
|
||||
print "Occurrences: update=$upd_count, delete=$del_count\n";
|
||||
close(FILE);
|
||||
EOF
|
||||
--let SEARCH_FILE=$log_error_
|
||||
--let SEARCH_PATTERN=The slave is applying a ROW event on behalf of an UPDATE statement on table t1 and is currently taking a considerable amount
|
||||
--source include/search_pattern_in_file.inc
|
||||
--let SEARCH_PATTERN=The slave is applying a ROW event on behalf of a DELETE statement on table t1 and is currently taking a considerable amount
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
# cleanup
|
||||
--source include/stop_slave.inc
|
||||
|
@ -26,6 +26,10 @@
|
||||
source include/have_innodb.inc;
|
||||
source include/master-slave.inc;
|
||||
|
||||
--connection slave
|
||||
let $initial_skipped_error= query_get_value(show global status like "Slave_skipped_errors", Value, 1);
|
||||
|
||||
connection master;
|
||||
--echo ==== Test Without sql_mode=strict_trans_tables ====
|
||||
|
||||
create table t1 (n int not null primary key);
|
||||
@ -133,8 +137,9 @@ connection slave;
|
||||
|
||||
CREATE TABLE t2(id INT NOT NULL PRIMARY KEY, data INT) Engine=MyIsam;
|
||||
SHOW CREATE TABLE t2;
|
||||
show global status like 'slave_skipped_errors';
|
||||
|
||||
let $current_skipped_error= query_get_value(show global status like "Slave_skipped_errors", Value, 1);
|
||||
--let $delta_skipped_error= `select $current_skipped_error - $initial_skipped_error from dual`
|
||||
--echo # Slave_skipped_errros = $delta_skipped_error
|
||||
connection master;
|
||||
|
||||
INSERT INTO t2 VALUES(1, 1);
|
||||
@ -151,7 +156,10 @@ sync_slave_with_master;
|
||||
|
||||
let $error= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
|
||||
echo $error;
|
||||
show global status like 'slave_skipped_errors';
|
||||
|
||||
let $current_skipped_error= query_get_value(show global status like "Slave_skipped_errors", Value, 1);
|
||||
--let $delta_skipped_error= `select $current_skipped_error - $initial_skipped_error from dual`
|
||||
--echo # Slave_skipped_errros = $delta_skipped_error
|
||||
|
||||
--echo **** We cannot execute a select as there are differences in the
|
||||
--echo **** behavior between STMT and RBR.
|
||||
|
@ -6214,6 +6214,7 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len)
|
||||
DBUG_ASSERT(debug_sync_service);
|
||||
DBUG_ASSERT(!debug_sync_set_action(current_thd,
|
||||
STRING_WITH_LEN(act)));
|
||||
dbug_rows_event_count = 0;
|
||||
};);
|
||||
#endif
|
||||
mysql_mutex_lock(&mi->data_lock);
|
||||
|
Reference in New Issue
Block a user