Below is the list of changes that have just been committed into a local
5.0 repository of matthias. When matthias does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.1972 05/11/17 21:19:29 mleich@stripped +8 -0
Fix for Bug#12429 Replication tests fail: "Slave_IO_Running" (?) differs
The problem with the "show slave status;" in rpl_until, rpl_deadlock, rpl_relayrotate
is, that depending on the total test engine
power and the current load caused by other processes, the expected slave status might be
not reached, though it will happen
in maybe some seconds. Typical effect Slave_IO_Running is "No" instead of "Yes".
Solution: Add an auxiliary script just before the call of "SHOW SLAVE STATUS".
This script checks within a loop if the desired state is reached. If yes or the maximum
sleeptime is reached the loop will be
left. If no, there comes a sleep 1 second.
Please have a look into include/wait_slave_status for detailed comments.
mysql-test/include/wait_slave_status.inc
1.1 05/11/17 21:19:19 mleich@stripped +155 -0
Auxiliary routine
mysql-test/t/rpl_until.test
1.20 05/11/17 21:19:19 mleich@stripped +4 -0
Add setting of additional resultpattern variable and call for auxiliary routine
mysql-test/t/rpl_relayrotate.test
1.15 05/11/17 21:19:19 mleich@stripped +4 -0
Add setting of additional resultpattern variable and call for auxiliary routine
mysql-test/t/rpl_deadlock.test
1.10 05/11/17 21:19:19 mleich@stripped +4 -0
Add setting of additional resultpattern variable and call for auxiliary routine
mysql-test/t/disabled.def
1.15 05/11/17 21:19:19 mleich@stripped +0 -3
Reactivation of testcases which were diabled because of Bug#12429
mysql-test/r/rpl_until.result
1.22 05/11/17 21:19:19 mleich@stripped +4 -0
Updated result
mysql-test/r/rpl_relayrotate.result
1.18 05/11/17 21:19:19 mleich@stripped +4 -0
Updated result
mysql-test/r/rpl_deadlock.result
1.8 05/11/17 21:19:19 mleich@stripped +4 -0
Updated result
mysql-test/include/wait_slave_status.inc
1.0 05/11/17 21:19:19 mleich@stripped +0 -0
BitKeeper file
/home/matthias/Arbeit/mysql-5.0/src-Y/mysql-test/include/wait_slave_status.inc
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: mleich
# Host: three.local.lan
# Root: /home/matthias/Arbeit/mysql-5.0/src-Y
--- 1.21/mysql-test/r/rpl_until.result 2005-03-25 14:51:03 +01:00
+++ 1.22/mysql-test/r/rpl_until.result 2005-11-17 21:19:19 +01:00
@@ -47,6 +47,10 @@
n
1
2
+
+let $result_pattern=
'%127.0.0.1%root%1%master-bin.000001%776%slave-relay-bin.000004%master-bin.000001%Yes%No%0%0%608%Relay%slave-relay-bin.000004%746%No%'
;
+
+--source include/wait_slave_status.inc
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 776 slave-relay-bin.000004 # master-bin.000001 Yes No 0 0 608 # Relay slave-relay-bin.000004 746 No #
--- 1.19/mysql-test/t/rpl_until.test 2005-09-01 17:27:03 +02:00
+++ 1.20/mysql-test/t/rpl_until.test 2005-11-17 21:19:19 +01:00
@@ -48,6 +48,10 @@
sleep 2;
wait_for_slave_to_stop;
select * from t2;
+### We expect to get a result for show slave status like
+### '# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 776
slave-relay-bin.000004#master-bin.000001 Yes No 0 0 608 # Relay slave-relay-bin.000004
746 No #'
+let $result_pattern=
'%127.0.0.1%root%1%master-bin.000001%776%slave-relay-bin.000004%master-bin.000001%Yes%No%0%0%608%Relay%slave-relay-bin.000004%746%No%';
+--source include/wait_slave_status.inc
--replace_result $MASTER_MYPORT MASTER_MYPORT
--replace_column 1 # 9 # 23 # 33 #
show slave status;
--- 1.7/mysql-test/r/rpl_deadlock.result 2005-07-13 14:15:21 +02:00
+++ 1.8/mysql-test/r/rpl_deadlock.result 2005-11-17 21:19:19 +01:00
@@ -81,6 +81,10 @@
select * from t2;
a
22
+
+let $result_pattern=
'%127.0.0.1%root%1%master-bin.000001%18911%%master-bin.000001%Yes%Yes%0%0%18911%None%0%No%'
;
+
+--source include/wait_slave_status.inc
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 18911 # # master-bin.000001 Yes Yes 0 0 18911 # None 0 No #
--- 1.17/mysql-test/r/rpl_relayrotate.result 2005-03-25 14:51:03 +01:00
+++ 1.18/mysql-test/r/rpl_relayrotate.result 2005-11-17 21:19:19 +01:00
@@ -16,6 +16,10 @@
select max(a) from t1;
max(a)
8000
+
+let $result_pattern=
'%127.0.0.1%root%1%master-bin.000001%735186%master-bin.000001%Yes%Yes%0%0%735186%None%0%No%'
;
+
+--source include/wait_slave_status.inc
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 735186 # # master-bin.000001 Yes Yes 0 0 735186 # None 0 No #
--- 1.9/mysql-test/t/rpl_deadlock.test 2005-09-01 17:27:02 +02:00
+++ 1.10/mysql-test/t/rpl_deadlock.test 2005-11-17 21:19:19 +01:00
@@ -102,6 +102,10 @@
sync_with_master;
select * from t1;
select * from t2;
+### We expect to get a result for show slave status like
+### '#127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 18911 # # master-bin.000001 Yes
Yes 0 0 18911 # None 0 No #'
+let $result_pattern=
'%127.0.0.1%root%1%master-bin.000001%18911%%master-bin.000001%Yes%Yes%0%0%18911%None%0%No%';
+--source include/wait_slave_status.inc
--replace_column 1 # 8 # 9 # 23 # 33 #
--replace_result $MASTER_MYPORT MASTER_MYPORT
show slave status;
--- 1.14/mysql-test/t/rpl_relayrotate.test 2005-07-28 15:12:36 +02:00
+++ 1.15/mysql-test/t/rpl_relayrotate.test 2005-11-17 21:19:19 +01:00
@@ -56,6 +56,10 @@
# (the only statement with position>=3000 is COMMIT).
select master_pos_wait('master-bin.001',3000)>=0;
select max(a) from t1;
+### We expect to get a result for show slave status like
+### '# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 735186 # # master-bin.000001 Yes
Yes 0 0 735186 # None 0 No #'
+let $result_pattern=
'%127.0.0.1%root%1%master-bin.000001%735186%master-bin.000001%Yes%Yes%0%0%735186%None%0%No%';
+--source include/wait_slave_status.inc
--replace_column 1 # 8 # 9 # 23 # 33 #
--replace_result $MASTER_MYPORT MASTER_MYPORT
show slave status;
--- 1.14/mysql-test/t/disabled.def 2005-11-16 15:16:53 +01:00
+++ 1.15/mysql-test/t/disabled.def 2005-11-17 21:19:19 +01:00
@@ -11,7 +11,4 @@
##############################################################################
sp-goto : GOTO is currently is disabled - will be fixed in the future
-rpl_relayrotate : Unstable test case, bug#12429
-rpl_until : Unstable test case, bug#12429
-rpl_deadlock : Unstable test case, bug#12429
kill : Unstable test case, bug#9712
--- New file ---
+++ mysql-test/include/wait_slave_status.inc 05/11/17 21:19:19
# include/wait_slave_status.inc
#
# Created by Matthias Leich
# Last update: 16.11.2005 ML
#
# Loop with sleeps until
# - a certain state is reached or
# - the maximum number of sleeps is reached
#
# Attention: The following parameters $result_pattern must be set within the
# script sourcing this routine.
# let $result_pattern= <pattern used for LIKE on the result of
# SHOW STATUS SLAVE>
# This method will not work, when the SHOW command delivers more
# than one result record, because only the first record will
# be caught.
#
# Example of development/usage: Testcase rpl_until
#
# the script:
# .....
# --replace_result $MASTER_MYPORT MASTER_MYPORT
# --replace_column 1 # 9 # 23 # 33 #
# show slave status;
#
# the expected protocol output (slightly modified with --vertical_results
# for better readibility)
# show slave status;
# Slave_IO_State #
# Master_Host 127.0.0.1
# Master_User root
# Master_Port MASTER_MYPORT
# Connect_Retry 1
# Master_Log_File master-bin.000001
# Read_Master_Log_Pos 776
# Relay_Log_File slave-relay-bin.000004
# Relay_Log_Pos #
# Relay_Master_Log_File master-bin.000001
# Slave_IO_Running Yes
# Slave_SQL_Running No
# Replicate_Do_DB
# Replicate_Ignore_DB
# Replicate_Do_Table
# Replicate_Ignore_Table
# Replicate_Wild_Do_Table
# Replicate_Wild_Ignore_Table
# Last_Errno 0
# Last_Error
# Skip_Counter 0
# Exec_Master_Log_Pos 319
# Relay_Log_Space #
# Until_Condition Master
# Until_Log_File master-bin.000001
# Until_Log_Pos 319
# Master_SSL_Allowed No
# Master_SSL_CA_File
# Master_SSL_CA_Path
# Master_SSL_Cert
# Master_SSL_Cipher
# Master_SSL_Key
# Seconds_Behind_Master #
#
# The main problem with the "show slave status;" in rpl_until is, that
# depending on the total test engine power and the current load caused by
# other processes, the expected slave status might be not reached though
# it will happen in maybe some seconds.
# The typical problem with rpl_until is that Slave_IO_Running is "No"
# instead of "Yes".
#
# An insertion of a "static" 'sleep <some_seconds>' before the 'show slave status;'
# will solve the problem but it has two disadvantages:
# - <some_seconds> might be not enough for extreme situations
# - there is a heavy unneeded loss of time if the Slave_IO_Running starts to
# be 'Yes' early enough
#
# The expected result follows the LIKE pattern:
# let $result_pattern=
'%127.0.0.1%root%1%master-bin.000001%776%slave-relay-bin.000004%master-bin.000001%Yes%No%0%0%319%Master%master-bin.000001%319%No%';
# The Slave_IO_Running value is the "Yes" just after the "master-bin.000001".
#
# How to get this pattern ?
#
# Any lines "--replace_result ..." and "--replace_colum ..." just before
# the SHOW TABLE STATUS and of course the expected result itself
# show us columns where the content must be unified, because it is non
# deterministic or it depends on the current test environment.
# Unfortunately "--replace_result ..." and "--replace_colum ..." do not
# affect the result of our assignment let $my_val= `SHOW SLAVE STATUS`;
# Therefore such content must be covered by '%'.
#
# Please be careful. A more simple pattern might be dangerous, because we
# might get "wrong" matches. Example: There might be several "Yes" and "No"
# within one result row.
#
###############################################################################
# We do not want to print the auxiliary commands, because they are not of
# interest and their amount will vary depending how fast we get the
# desired state.
--disable_query_log
# The protocol should show
# - the setting of $result_pattern and
# - that this file is sourced ,
# because this increases the chance to use the protocol as replay script.
eval SELECT "let \$result_pattern= $result_pattern ;" AS "";
SELECT '--source include/wait_slave_status.inc' AS "";
# We accept to wait in maximum 30 seconds.
let $max_wait= 30;
while ($max_wait)
{
let $my_val= `SHOW SLAVE STATUS`;
# Now we have the first record of the SHOW result set as one fat string
# within the variable $my_val.
eval SET @my_val = '$my_val';
# DEBUG eval SELECT @my_val AS "response to SHOW SLAVE STATUS";
eval SELECT @my_val LIKE $result_pattern INTO @success;
# @success is '1' if we have a match
# '0' if we have no match
# DEBUG SELECT @success;
let $success= `SELECT @success`;
let $no_success= `SELECT @success = 0`;
if ($success)
{
# We reached the expected result and want to jump out of the loop
# without unneeded sleeps.
# Attention: Do not set $max_wait to 0, because "while" with negative value
# does not work.
let $max_wait= 1;
}
if ($no_success)
{
# We did not reach the expected result and will have to sleep again
# or jump out of the loop, when max_wait is exhausted.
sleep 1;
}
dec $max_wait;
}
--enable_query_log
if ($no_success)
{
let $message= ! Attention: We left the waitloop without getting the desired state.
| Possible reasons with decreasing probability:
| - The LIKE pattern ($result_pattern) is wrong, because the
| testcase was altered or the layout of the
| SHOW SLAVE STATUS result set changed.
| - There is a new bug within the replication.
| - We met an extreme testing environment and $max_wait is
| too small.;
--source include/show_msg80.inc
}
| Thread |
|---|
| • bk commit into 5.0 tree (mleich:1.1972) BUG#12429 | mleich | 17 Nov |