#At file:///home/ksm/oracle/repo/bug54820/build-trunk/ based on revid:davi.arnaut@stripped
3128 Serge Kozlov 2010-07-20
Bug#54820. Set separate values of MASTER_CONNECT_RETRY for usual execution and for Valgrind environment
modified:
mysql-test/suite/rpl/r/rpl_heartbeat_basic.result
mysql-test/suite/rpl/t/rpl_heartbeat_basic.test
=== modified file 'mysql-test/suite/rpl/r/rpl_heartbeat_basic.result'
--- a/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result 2010-03-16 19:23:55 +0000
+++ b/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result 2010-07-20 10:59:14 +0000
@@ -86,7 +86,7 @@ SET @@global.slave_net_timeout=@restore_
*** Start/stop slave ***
SET @@global.slave_net_timeout=100;
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=20;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=#, MASTER_USER='root', MASTER_CONNECT_RETRY=#, MASTER_HEARTBEAT_PERIOD=20;
include/start_slave.inc
SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
Variable_name Value
@@ -98,7 +98,7 @@ Slave_heartbeat_period 20.000
*** Reload slave ***
SET @@global.slave_net_timeout=50;
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=30;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=#, MASTER_USER='root', MASTER_CONNECT_RETRY=#, MASTER_HEARTBEAT_PERIOD=30;
Reload slave
SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
Variable_name Value
@@ -106,7 +106,7 @@ Slave_heartbeat_period 30.000
SET @restore_slave_net_timeout=@@global.slave_net_timeout;
*** Disable heartbeat ***
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=#, MASTER_USER='root', MASTER_CONNECT_RETRY=#, MASTER_HEARTBEAT_PERIOD=0;
SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
Variable_name Value
Slave_heartbeat_period 0.000
@@ -176,7 +176,7 @@ ERROR 42000: You have an error in your S
RESET SLAVE;
*** Running slave ***
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.1;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=#, MASTER_USER='root', MASTER_CONNECT_RETRY=#, MASTER_HEARTBEAT_PERIOD=0.1;
include/start_slave.inc
Heartbeat event received
@@ -220,7 +220,7 @@ BEGIN
UPDATE test.t1 SET a = a + 1 WHERE a < 10;
END|
RESET SLAVE;
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=5;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=#, MASTER_USER='root', MASTER_CONNECT_RETRY=#, MASTER_HEARTBEAT_PERIOD=5;
include/start_slave.inc
SET @@global.event_scheduler=1;
Number of received heartbeat events: 0
@@ -233,7 +233,7 @@ RESET SLAVE;
DROP TABLE t1;
DROP TABLE t1;
RESET MASTER;
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.5;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=#, MASTER_USER='root', MASTER_CONNECT_RETRY=#, MASTER_HEARTBEAT_PERIOD=0.5;
include/start_slave.inc
Heartbeat events are received while rotation of relay logs (1 means 'yes'): 1
@@ -242,7 +242,7 @@ SET @@global.slave_compressed_protocol=1
include/stop_slave.inc
RESET SLAVE;
SET @@global.slave_compressed_protocol=1;
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.1;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=#, MASTER_USER='root', MASTER_CONNECT_RETRY=#, MASTER_HEARTBEAT_PERIOD=0.1;
include/start_slave.inc
Heartbeat event received
SET @@global.slave_compressed_protocol=0;
@@ -251,7 +251,7 @@ SET @@global.slave_compressed_protocol=0
*** Reset master ***
STOP SLAVE;
RESET SLAVE;
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.1;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=#, MASTER_USER='root', MASTER_CONNECT_RETRY=#, MASTER_HEARTBEAT_PERIOD=0.1;
include/start_slave.inc
RESET MASTER;
Heartbeat events are received after reset of master (1 means 'yes'): 1
@@ -259,7 +259,7 @@ Heartbeat events are received after rese
*** Reload master ***
STOP SLAVE;
RESET SLAVE;
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.1;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=#, MASTER_USER='root', MASTER_CONNECT_RETRY=#, MASTER_HEARTBEAT_PERIOD=0.1;
include/start_slave.inc
Heartbeat event received
Reload master
@@ -273,7 +273,7 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
include/stop_slave.inc
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=SLAVE_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=1, MASTER_LOG_FILE='SLAVE_BINLOG';
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=#, MASTER_USER='root', MASTER_CONNECT_RETRY=#, MASTER_HEARTBEAT_PERIOD=1, MASTER_LOG_FILE=SLAVE_BINLOG;
include/start_slave.inc
CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10));
INSERT INTO t1 VALUES(1, 'on master');
=== modified file 'mysql-test/suite/rpl/t/rpl_heartbeat_basic.test'
--- a/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test 2010-03-16 19:23:55 +0000
+++ b/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test 2010-07-20 10:59:14 +0000
@@ -18,6 +18,11 @@
--source include/have_binlog_format_mixed.inc
--echo
+# Increase timeout between slave's attempts to connect to master if test runs with and without valgrind
+let $master_connect_retry= 5;
+if (`SELECT $VALGRIND_TEST = 1`) {
+ let $master_connect_retry= 20;
+}
--echo *** Preparing ***
--connection slave
--source include/stop_slave.inc
@@ -136,8 +141,8 @@ SET @@global.slave_net_timeout=@restore_
--disable_warnings
SET @@global.slave_net_timeout=100;
--enable_warnings
---replace_result $MASTER_MYPORT MASTER_PORT
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=20;
+--replace_regex /MASTER_PORT=[0-9]+/MASTER_PORT=#/ /MASTER_CONNECT_RETRY=[0-9]+/MASTER_CONNECT_RETRY=#/
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$master_connect_retry, MASTER_HEARTBEAT_PERIOD=20;
--source include/start_slave.inc
--sync_with_master
SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
@@ -151,8 +156,8 @@ SHOW GLOBAL STATUS LIKE 'slave_heartbeat
--disable_warnings
SET @@global.slave_net_timeout=50;
--enable_warnings
---replace_result $MASTER_MYPORT MASTER_PORT
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=30;
+--replace_regex /MASTER_PORT=[0-9]+/MASTER_PORT=#/ /MASTER_CONNECT_RETRY=[0-9]+/MASTER_CONNECT_RETRY=#/
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$master_connect_retry, MASTER_HEARTBEAT_PERIOD=30;
--write_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
wait
EOF
@@ -170,8 +175,8 @@ SET @restore_slave_net_timeout=@@global.
# Disable heartbeat
--echo *** Disable heartbeat ***
---replace_result $MASTER_MYPORT MASTER_PORT
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0;
+--replace_regex /MASTER_PORT=[0-9]+/MASTER_PORT=#/ /MASTER_CONNECT_RETRY=[0-9]+/MASTER_CONNECT_RETRY=#/
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$master_connect_retry, MASTER_HEARTBEAT_PERIOD=0;
SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
SHOW STATUS LIKE 'slave_received_heartbeats';
--source include/start_slave.inc
@@ -245,8 +250,8 @@ RESET SLAVE;
# Check received heartbeat events for running slave
--echo *** Running slave ***
---replace_result $MASTER_MYPORT MASTER_PORT
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.1;
+--replace_regex /MASTER_PORT=[0-9]+/MASTER_PORT=#/ /MASTER_CONNECT_RETRY=[0-9]+/MASTER_CONNECT_RETRY=#/
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$master_connect_retry, MASTER_HEARTBEAT_PERIOD=0.1;
--source include/start_slave.inc
--sync_with_master
let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
@@ -348,8 +353,8 @@ CREATE EVENT e1
DELIMITER ;|
--connection slave
RESET SLAVE;
---replace_result $MASTER_MYPORT MASTER_PORT
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=5;
+--replace_regex /MASTER_PORT=[0-9]+/MASTER_PORT=#/ /MASTER_CONNECT_RETRY=[0-9]+/MASTER_CONNECT_RETRY=#/
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$master_connect_retry, MASTER_HEARTBEAT_PERIOD=5;
--source include/start_slave.inc
--connection master
# Enable scheduler
@@ -381,8 +386,8 @@ DROP TABLE t1;
DROP TABLE t1;
RESET MASTER;
--connection slave
---replace_result $MASTER_MYPORT MASTER_PORT
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.5;
+--replace_regex /MASTER_PORT=[0-9]+/MASTER_PORT=#/ /MASTER_CONNECT_RETRY=[0-9]+/MASTER_CONNECT_RETRY=#/
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$master_connect_retry, MASTER_HEARTBEAT_PERIOD=0.5;
let $slave_param_comparison= =;
--source include/start_slave.inc
let $rcvd_heartbeats_before= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
@@ -408,8 +413,8 @@ SET @@global.slave_compressed_protocol=1
--source include/stop_slave.inc
RESET SLAVE;
SET @@global.slave_compressed_protocol=1;
---replace_result $MASTER_MYPORT MASTER_PORT
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.1;
+--replace_regex /MASTER_PORT=[0-9]+/MASTER_PORT=#/ /MASTER_CONNECT_RETRY=[0-9]+/MASTER_CONNECT_RETRY=#/
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$master_connect_retry, MASTER_HEARTBEAT_PERIOD=0.1;
--source include/start_slave.inc
let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
let $status_var= slave_received_heartbeats;
@@ -427,8 +432,8 @@ SET @@global.slave_compressed_protocol=0
--connection slave
STOP SLAVE;
RESET SLAVE;
---replace_result $MASTER_MYPORT MASTER_PORT
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.1;
+--replace_regex /MASTER_PORT=[0-9]+/MASTER_PORT=#/ /MASTER_CONNECT_RETRY=[0-9]+/MASTER_CONNECT_RETRY=#/
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$master_connect_retry, MASTER_HEARTBEAT_PERIOD=0.1;
--source include/start_slave.inc
let $rcvd_heartbeats_before= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
--connection master
@@ -446,8 +451,8 @@ let $result= query_get_value(SELECT ($rc
--connection slave
STOP SLAVE;
RESET SLAVE;
---replace_result $MASTER_MYPORT MASTER_PORT
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.1;
+--replace_regex /MASTER_PORT=[0-9]+/MASTER_PORT=#/ /MASTER_CONNECT_RETRY=[0-9]+/MASTER_CONNECT_RETRY=#/
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$master_connect_retry, MASTER_HEARTBEAT_PERIOD=0.1;
--source include/start_slave.inc
# Wait until slave_received_heartbeats will be incremented
let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
@@ -487,8 +492,8 @@ let $status_var_comparsion= >;
--source include/stop_slave.inc
let $slave_binlog= query_get_value(SHOW MASTER STATUS, File, 1);
--connection master
---replace_result $SLAVE_MYPORT SLAVE_PORT $slave_binlog SLAVE_BINLOG
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$SLAVE_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=1, MASTER_LOG_FILE='$slave_binlog';
+--replace_regex /MASTER_PORT=[0-9]+/MASTER_PORT=#/ /MASTER_CONNECT_RETRY=[0-9]+/MASTER_CONNECT_RETRY=#/ /MASTER_LOG_FILE='.+'/MASTER_LOG_FILE=SLAVE_BINLOG/
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$SLAVE_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$master_connect_retry, MASTER_HEARTBEAT_PERIOD=1, MASTER_LOG_FILE='$slave_binlog';
--source include/start_slave.inc
# Insert data on master and on slave and make sure that it replicated for both directions
Attachment: [text/bzr-bundle] bzr/serge.kozlov@sun.com-20100720105914-ghlrhsdqv9tpides.bundle