diff options
author | unknown <guilhem@mysql.com> | 2003-06-16 15:49:54 +0200 |
---|---|---|
committer | unknown <guilhem@mysql.com> | 2003-06-16 15:49:54 +0200 |
commit | 366fd92e8d882737268f354e0a744d576868a043 (patch) | |
tree | 746b2aefd7b3603ad4f2323a36673ea63a4d2197 | |
parent | 0783f9001340ff848922d9ad60a9eef2c6b0dbac (diff) | |
download | mariadb-git-366fd92e8d882737268f354e0a744d576868a043.tar.gz |
Fix for nightly build test failure (test update).
More messages.
Testcase for bug 651.
client/mysqltest.c:
More explicit error message if MASTER_POS_WAIT() returns NULL.
mysql-test/r/rpl_loaddata.result:
result update
mysql-test/r/rpl_master_pos_wait.result:
result update
mysql-test/t/rpl000001.test:
sync_with_master (=MASTER_POS_WAIT()) was called when we could expect the SQL slave thread had stopped.
As I yesterday changed code so that "SQL thread stops => MASTER_POS_WAIT() returns NULL immediately" (bugfix),
sync_with_master received NULL (on build.mysql.com, not on my machine; this is a question of milliseconds,
if the slave server will process MASTER_POS_WAIT() before or after the slave SQL thread has stopped), and
in mysqltest.c, sync_with_master complained that it could not sync.
So I just remove this sync_with_master, which does not make sense anymore: we just wait for the slave SQL
thread to stop.
mysql-test/t/rpl_loaddata.test:
Discovered we had wait_for_slave_to_stop, so used it as it automates things.
mysql-test/t/rpl_master_pos_wait.test:
Discovered we had 'send' to send a query without waiting for the resultn so could had a testcase for bug 651.
Shorter timeouts as there is no risk the position is reached.
sql/slave.cc:
A longer DBUG_PRINT.
-rw-r--r-- | client/mysqltest.c | 3 | ||||
-rw-r--r-- | mysql-test/r/rpl_loaddata.result | 3 | ||||
-rw-r--r-- | mysql-test/r/rpl_master_pos_wait.result | 8 | ||||
-rw-r--r-- | mysql-test/t/rpl000001.test | 4 | ||||
-rw-r--r-- | mysql-test/t/rpl_loaddata.test | 8 | ||||
-rw-r--r-- | mysql-test/t/rpl_master_pos_wait.test | 10 | ||||
-rw-r--r-- | sql/slave.cc | 13 |
7 files changed, 31 insertions, 18 deletions
diff --git a/client/mysqltest.c b/client/mysqltest.c index f6c999b18e4..f5afa0fa0df 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -996,7 +996,8 @@ int do_sync_with_master2(const char* p) if (!(row = mysql_fetch_row(res))) die("line %u: empty result in %s", start_lineno, query_buf); if (!row[0]) - die("Error on slave while syncing with master"); + die("line %u: could not sync with master ('%s' returned NULL)", + start_lineno, query_buf); mysql_free_result(res); last_result=0; if (rpl_parse) diff --git a/mysql-test/r/rpl_loaddata.result b/mysql-test/r/rpl_loaddata.result index 844a9d66cb3..b5154ca95cf 100644 --- a/mysql-test/r/rpl_loaddata.result +++ b/mysql-test/r/rpl_loaddata.result @@ -25,6 +25,3 @@ drop table t3; create table t1(a int, b int, unique(b)); insert into t1 values(1,10); load data infile '../../std_data/rpl_loaddata.dat' into table t1; -show status like 'slave_running'; -Variable_name Value -Slave_running OFF diff --git a/mysql-test/r/rpl_master_pos_wait.result b/mysql-test/r/rpl_master_pos_wait.result index 22c7aef621c..cb6ee31a54d 100644 --- a/mysql-test/r/rpl_master_pos_wait.result +++ b/mysql-test/r/rpl_master_pos_wait.result @@ -4,6 +4,10 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; slave start; -select master_pos_wait('master-bin.999999',0,10); -master_pos_wait('master-bin.999999',0,10) +select master_pos_wait('master-bin.999999',0,2); +master_pos_wait('master-bin.999999',0,2) -1 + select master_pos_wait('master-bin.999999',0); +stop slave sql_thread; +master_pos_wait('master-bin.999999',0) +NULL diff --git a/mysql-test/t/rpl000001.test b/mysql-test/t/rpl000001.test index 4ffd7d1d78e..ebce3d0ac94 100644 --- a/mysql-test/t/rpl000001.test +++ b/mysql-test/t/rpl000001.test @@ -90,8 +90,8 @@ connection master; --error 1053; reap; connection slave; -sync_with_master; -#give the slave a chance to exit +# The SQL slave thread should now have stopped because the query was killed on +# the master (so it has a non-zero error code in the binlog). wait_for_slave_to_stop; # The following test can't be done because the result of Pos will differ diff --git a/mysql-test/t/rpl_loaddata.test b/mysql-test/t/rpl_loaddata.test index dc4eadda192..96a4eb3fb76 100644 --- a/mysql-test/t/rpl_loaddata.test +++ b/mysql-test/t/rpl_loaddata.test @@ -42,9 +42,5 @@ load data infile '../../std_data/rpl_loaddata.dat' into table t1; save_master_pos; connection slave; -# don't sync_with_master because the slave SQL thread should be stopped because -# of the error so MASTER_POS_WAIT() will not return; just sleep and hope the -# slave SQL thread will have had time to stop. - -sleep 1; -show status like 'slave_running'; +# The SQL slave thread should be stopped now. +wait_for_slave_to_stop; diff --git a/mysql-test/t/rpl_master_pos_wait.test b/mysql-test/t/rpl_master_pos_wait.test index a6aae222a89..24479636c91 100644 --- a/mysql-test/t/rpl_master_pos_wait.test +++ b/mysql-test/t/rpl_master_pos_wait.test @@ -5,5 +5,11 @@ save_master_pos; connection slave; sync_with_master; # Ask for a master log that has certainly not been reached yet -# timeout= 10 seconds -select master_pos_wait('master-bin.999999',0,10); +# timeout= 2 seconds +select master_pos_wait('master-bin.999999',0,2); +# Testcase for bug 651 (master_pos_wait() hangs if slave idle and STOP SLAVE). +send select master_pos_wait('master-bin.999999',0); +connection slave1; +stop slave sql_thread; +connection slave; +reap; diff --git a/sql/slave.cc b/sql/slave.cc index 73f1073ae09..dc9ce9715d8 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -2445,8 +2445,17 @@ reconnect done to recover from failed read"); for no reason, but this function will do a clean read, notice the clean value and exit immediately. */ - DBUG_PRINT("info", ("ignore_log_space_limit=%d", (int) - mi->rli.ignore_log_space_limit)); +#ifndef DBUG_OFF + { + char llbuf1[22], llbuf2[22]; + DBUG_PRINT("info", ("log_space_limit=%s log_space_total=%s \ +ignore_log_space_limit=%d", + llstr(mi->rli.log_space_limit,llbuf1), + llstr(mi->rli.log_space_total,llbuf2), + (int) mi->rli.ignore_log_space_limit)); + } +#endif + if (mi->rli.log_space_limit && mi->rli.log_space_limit < mi->rli.log_space_total && !mi->rli.ignore_log_space_limit) |