Commit 1e0f09ca authored by sachin's avatar sachin Committed by Sachin Setiya

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.
parent 01bf9f8c
...@@ -431,5 +431,7 @@ call mtr.add_suppression("Can't generate a unique log-filename .*"); ...@@ -431,5 +431,7 @@ call mtr.add_suppression("Can't generate a unique log-filename .*");
-- source include/stop_slave_sql.inc -- source include/stop_slave_sql.inc
RESET SLAVE; RESET SLAVE;
RESET MASTER; RESET MASTER;
--remove_file $load_file
--remove_file $load_file2
--let $rpl_only_running_threads= 1 --let $rpl_only_running_threads= 1
--source include/rpl_end.inc --source include/rpl_end.inc
include/master-slave.inc include/master-slave.inc
[connection master] [connection master]
connection slave;
connection master;
create table t1 (n int); create table t1 (n int);
insert into t1 values(1); insert into t1 values(1);
connection slave; connection slave;
show global status like 'com_insert'; # Com_insert = 1
Variable_name Value
Com_insert 1
stop slave; stop slave;
show global status like 'com_insert'; # Com_insert = 1
Variable_name Value
Com_insert 1
include/wait_for_slave_to_stop.inc include/wait_for_slave_to_stop.inc
start slave; start slave;
include/wait_for_slave_to_start.inc include/wait_for_slave_to_start.inc
......
...@@ -64,3 +64,5 @@ Master-Host: 127.0.0.1 ...@@ -64,3 +64,5 @@ Master-Host: 127.0.0.1
change master to master_host='0:0:0:0:0: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 Master-Host: 0:0:0:0:0:0:0:1
CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root'; 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 ...@@ -64,3 +64,5 @@ Master-Host: 127.0.0.1
change master to master_host='0:0:0:0:0: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 Master-Host: 0:0:0:0:0:0:0:1
CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root'; 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 ''; ...@@ -128,4 +128,6 @@ show binlog events in '';
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
purge master logs before now(); purge master logs before now();
End of 5.0 tests End of 5.0 tests
#cleanup
include/stop_slave.inc include/stop_slave.inc
reset slave all;
...@@ -15,7 +15,8 @@ DELETE FROM t1; ...@@ -15,7 +15,8 @@ DELETE FROM t1;
DROP TABLE t1; DROP TABLE t1;
connection slave; connection slave;
# Check if any note related to long DELETE_ROWS and UPDATE_ROWS appears in the error log # 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 include/stop_slave.inc
SET GLOBAL debug_dbug = ''; SET GLOBAL debug_dbug = '';
SET GLOBAL log_warnings = 2; SET GLOBAL log_warnings = 2;
......
include/master-slave.inc include/master-slave.inc
[connection master] [connection master]
connection slave;
connection master;
==== Test Without sql_mode=strict_trans_tables ==== ==== Test Without sql_mode=strict_trans_tables ====
create table t1 (n int not null primary key); create table t1 (n int not null primary key);
connection slave; connection slave;
...@@ -105,9 +107,7 @@ t2 CREATE TABLE `t2` ( ...@@ -105,9 +107,7 @@ t2 CREATE TABLE `t2` (
`data` int(11) DEFAULT NULL, `data` int(11) DEFAULT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
show global status like 'slave_skipped_errors'; # Slave_skipped_errros = 4
Variable_name Value
Slave_skipped_errors 4
connection master; connection master;
INSERT INTO t2 VALUES(1, 1); INSERT INTO t2 VALUES(1, 1);
INSERT INTO t2 VALUES(2, 1); INSERT INTO t2 VALUES(2, 1);
...@@ -119,9 +119,7 @@ SET SQL_LOG_BIN=1; ...@@ -119,9 +119,7 @@ SET SQL_LOG_BIN=1;
UPDATE t2 SET id= id + 3, data = 2; UPDATE t2 SET id= id + 3, data = 2;
connection slave; connection slave;
show global status like 'slave_skipped_errors'; # Slave_skipped_errros = 5
Variable_name Value
Slave_skipped_errors 5
**** We cannot execute a select as there are differences in the **** We cannot execute a select as there are differences in the
**** behavior between STMT and RBR. **** behavior between STMT and RBR.
==== Clean Up ==== ==== Clean Up ====
......
...@@ -5,19 +5,19 @@ ...@@ -5,19 +5,19 @@
# #
source include/master-slave.inc; 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); create table t1 (n int);
insert into t1 values(1); insert into t1 values(1);
sync_slave_with_master; 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; stop slave;
# Temporary work-around for bug MDEV-8301. There is a small window during let $current_com_insert= query_get_value(show global status like "Com_insert", Value, 1);
# thread exit where the local status values of a thread are counted twice --let $delta_com_insert= `select $current_com_insert - $initial_com_insert from dual`
# in the global status. Remove this wait_condition.inc once MDEV-8301 is --echo # Com_insert = $delta_com_insert
# 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';
--source include/wait_for_slave_to_stop.inc --source include/wait_for_slave_to_stop.inc
start slave; start slave;
--source include/wait_for_slave_to_start.inc --source include/wait_for_slave_to_start.inc
......
...@@ -44,3 +44,5 @@ let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1); ...@@ -44,3 +44,5 @@ let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
# clean up # clean up
CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root'; 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); ...@@ -45,3 +45,5 @@ let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
# clean up # clean up
CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root'; 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 ''; ...@@ -193,4 +193,8 @@ show binlog events in '';
purge master logs before now(); purge master logs before now();
--echo End of 5.0 tests --echo End of 5.0 tests
--echo #cleanup
--remove_file $MYSQLD_SLAVE_DATADIR/master.info
--source include/stop_slave.inc --source include/stop_slave.inc
reset slave all;
...@@ -42,16 +42,11 @@ DROP TABLE t1; ...@@ -42,16 +42,11 @@ DROP TABLE t1;
--sync_slave_with_master --sync_slave_with_master
--echo # Check if any note related to long DELETE_ROWS and UPDATE_ROWS appears in the error log --echo # Check if any note related to long DELETE_ROWS and UPDATE_ROWS appears in the error log
perl; --let SEARCH_FILE=$log_error_
use strict; --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
my $log_error= $ENV{'LOG_ERROR'} or die "LOG_ERROR not set"; --source include/search_pattern_in_file.inc
open(FILE, "$log_error") or die("Unable to open $log_error: $!\n"); --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
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>); --source include/search_pattern_in_file.inc
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
# cleanup # cleanup
--source include/stop_slave.inc --source include/stop_slave.inc
......
...@@ -26,6 +26,10 @@ ...@@ -26,6 +26,10 @@
source include/have_innodb.inc; source include/have_innodb.inc;
source include/master-slave.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 ==== --echo ==== Test Without sql_mode=strict_trans_tables ====
create table t1 (n int not null primary key); create table t1 (n int not null primary key);
...@@ -133,8 +137,9 @@ connection slave; ...@@ -133,8 +137,9 @@ connection slave;
CREATE TABLE t2(id INT NOT NULL PRIMARY KEY, data INT) Engine=MyIsam; CREATE TABLE t2(id INT NOT NULL PRIMARY KEY, data INT) Engine=MyIsam;
SHOW CREATE TABLE t2; 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; connection master;
INSERT INTO t2 VALUES(1, 1); INSERT INTO t2 VALUES(1, 1);
...@@ -151,7 +156,10 @@ sync_slave_with_master; ...@@ -151,7 +156,10 @@ sync_slave_with_master;
let $error= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1); let $error= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
echo $error; 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 **** We cannot execute a select as there are differences in the
--echo **** behavior between STMT and RBR. --echo **** behavior between STMT and RBR.
......
...@@ -6214,6 +6214,7 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len) ...@@ -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_service);
DBUG_ASSERT(!debug_sync_set_action(current_thd, DBUG_ASSERT(!debug_sync_set_action(current_thd,
STRING_WITH_LEN(act))); STRING_WITH_LEN(act)));
dbug_rows_event_count = 0;
};); };);
#endif #endif
mysql_mutex_lock(&mi->data_lock); mysql_mutex_lock(&mi->data_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment