diff options
-rw-r--r-- | mysql-test/r/rpl000016.result | 4 | ||||
-rw-r--r-- | mysql-test/t/rpl000001.test | 1 | ||||
-rw-r--r-- | mysql-test/t/rpl000002.test | 1 | ||||
-rw-r--r-- | mysql-test/t/rpl000003.test | 1 | ||||
-rw-r--r-- | mysql-test/t/rpl000007.test | 1 | ||||
-rw-r--r-- | mysql-test/t/rpl000008.test | 1 | ||||
-rw-r--r-- | mysql-test/t/rpl000009.test | 1 | ||||
-rw-r--r-- | mysql-test/t/rpl000010.test | 2 | ||||
-rw-r--r-- | mysql-test/t/rpl000011.test | 2 | ||||
-rw-r--r-- | mysql-test/t/rpl000012.test | 1 | ||||
-rw-r--r-- | mysql-test/t/rpl000013.test | 1 | ||||
-rw-r--r-- | mysql-test/t/rpl000014.test | 1 | ||||
-rw-r--r-- | mysql-test/t/rpl000015.test | 4 | ||||
-rw-r--r-- | mysql-test/t/rpl000016.test | 8 | ||||
-rw-r--r-- | sql/slave.cc | 18 |
15 files changed, 20 insertions, 27 deletions
diff --git a/mysql-test/r/rpl000016.result b/mysql-test/r/rpl000016.result index 5d0ff3877b8..ae5b83a4a85 100644 --- a/mysql-test/r/rpl000016.result +++ b/mysql-test/r/rpl000016.result @@ -1,3 +1,5 @@ +Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db +127.0.0.1 root 9306 60 master-bin.001 216 Yes s Could not break slave Tried hard @@ -7,6 +9,8 @@ master-bin.002 master-bin.003 Log_name master-bin.003 +Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db +127.0.0.1 root 9306 60 master-bin.003 128 Yes m 34 67 diff --git a/mysql-test/t/rpl000001.test b/mysql-test/t/rpl000001.test index 0765fc6e318..c7b1f817e81 100644 --- a/mysql-test/t/rpl000001.test +++ b/mysql-test/t/rpl000001.test @@ -12,7 +12,6 @@ insert into foo values(1),(2); save_master_pos; connection slave; sync_with_master; -sleep 1; use test; select * from foo; select sum(length(word)) from t1; diff --git a/mysql-test/t/rpl000002.test b/mysql-test/t/rpl000002.test index 680deabb6af..c982bd54b8c 100644 --- a/mysql-test/t/rpl000002.test +++ b/mysql-test/t/rpl000002.test @@ -9,7 +9,6 @@ save_master_pos; connection slave; use test; sync_with_master; -sleep 1; @r/rpl000002.result select * from t1; connection master; drop table t1; diff --git a/mysql-test/t/rpl000003.test b/mysql-test/t/rpl000003.test index 2ab4584faf2..b5957615c5b 100644 --- a/mysql-test/t/rpl000003.test +++ b/mysql-test/t/rpl000003.test @@ -7,7 +7,6 @@ insert into t1 values (3); save_master_pos; connection slave; sync_with_master; -sleep 1; @r/rpl000003.result select * from t1; connection master; drop table t1; diff --git a/mysql-test/t/rpl000007.test b/mysql-test/t/rpl000007.test index 2834aa4dcc3..5b121afaa99 100644 --- a/mysql-test/t/rpl000007.test +++ b/mysql-test/t/rpl000007.test @@ -18,7 +18,6 @@ insert into bar values(15); save_master_pos; connection slave; sync_with_master; -sleep 1; @r/rpl000007.result select foo.n,bar.m from foo,bar; connection master; drop table if exists bar,foo; diff --git a/mysql-test/t/rpl000008.test b/mysql-test/t/rpl000008.test index c4bbdb48a1e..8cbc724c3a6 100644 --- a/mysql-test/t/rpl000008.test +++ b/mysql-test/t/rpl000008.test @@ -20,7 +20,6 @@ insert into choo values(55); save_master_pos; connection slave; sync_with_master; -sleep 1; @r/rpl000008.result select foo.n,bar.m,choo.k from foo,bar,choo; connection master; drop table if exists foo,bar,choo; diff --git a/mysql-test/t/rpl000009.test b/mysql-test/t/rpl000009.test index 15776384b63..1f20981f7d0 100644 --- a/mysql-test/t/rpl000009.test +++ b/mysql-test/t/rpl000009.test @@ -22,7 +22,6 @@ insert into bar.bar values(15); save_master_pos; connection slave; sync_with_master; -sleep 1; @r/rpl000009.result select foo.foo.n,bar.bar.m from foo.foo,bar.bar; connection master; drop database if exists bar; diff --git a/mysql-test/t/rpl000010.test b/mysql-test/t/rpl000010.test index 65ceb98fd68..8f6b8d449ac 100644 --- a/mysql-test/t/rpl000010.test +++ b/mysql-test/t/rpl000010.test @@ -11,10 +11,10 @@ insert into t1 values(2); save_master_pos; connection slave; sync_with_master; -sleep 1; @r/rpl000010.result select n from t1; connection master; drop table t1; save_master_pos; connection slave; sync_with_master; + diff --git a/mysql-test/t/rpl000011.test b/mysql-test/t/rpl000011.test index 8e9129f875e..04b6898f74a 100644 --- a/mysql-test/t/rpl000011.test +++ b/mysql-test/t/rpl000011.test @@ -6,7 +6,6 @@ create table t1 (n int); insert into t1 values(1); save_master_pos; connection slave; -#give slave some breathing room to get started sync_with_master; slave stop; slave start; @@ -16,7 +15,6 @@ save_master_pos; connection slave; #let slave catch up sync_with_master; -sleep 1; @r/rpl000011.result select * from t1; connection master; drop table t1; diff --git a/mysql-test/t/rpl000012.test b/mysql-test/t/rpl000012.test index 07bff33e482..495cb81167e 100644 --- a/mysql-test/t/rpl000012.test +++ b/mysql-test/t/rpl000012.test @@ -19,7 +19,6 @@ connection master2; save_master_pos; connection slave; sync_with_master; -sleep 1; @r/rpl000012.result select * from t2; @r/rpl000012.status.result show status like 'Slave_open_temp_tables'; # diff --git a/mysql-test/t/rpl000013.test b/mysql-test/t/rpl000013.test index 20325b6a36d..f5056839791 100644 --- a/mysql-test/t/rpl000013.test +++ b/mysql-test/t/rpl000013.test @@ -22,7 +22,6 @@ connection master2; save_master_pos; connection slave; sync_with_master; -sleep 1; @r/rpl000013.result select * from t2; @r/rpl000013.status.result show status like 'Slave_open_temp_tables'; # diff --git a/mysql-test/t/rpl000014.test b/mysql-test/t/rpl000014.test index e1d483c7ea5..34e160a760c 100644 --- a/mysql-test/t/rpl000014.test +++ b/mysql-test/t/rpl000014.test @@ -24,7 +24,6 @@ save_master_pos; connection slave; change master to master_log_pos=73; sync_with_master; -sleep 1; select * from foo; connection master; drop table foo; diff --git a/mysql-test/t/rpl000015.test b/mysql-test/t/rpl000015.test index db5b3c720b2..ce04b18d2e8 100644 --- a/mysql-test/t/rpl000015.test +++ b/mysql-test/t/rpl000015.test @@ -4,6 +4,7 @@ source include/have_default_master.inc; connection master; reset master; show master status; +save_master_pos; connection slave; reset slave; show slave status; @@ -13,7 +14,7 @@ change master to master_host='127.0.0.1',master_user='root', master_password='',master_port=9306; show slave status; slave start; -sleep 3; +sync_with_master; show slave status; connection master; drop table if exists foo; @@ -22,7 +23,6 @@ insert into foo values (10),(45),(90); save_master_pos; connection slave; sync_with_master; -sleep 1; select * from foo; connection master; drop table foo; diff --git a/mysql-test/t/rpl000016.test b/mysql-test/t/rpl000016.test index e5f1649a504..f9ef99c62b6 100644 --- a/mysql-test/t/rpl000016.test +++ b/mysql-test/t/rpl000016.test @@ -10,6 +10,9 @@ system chmod 600 var/slave-data/master.info; !change master to master_host='127.0.0.1',master_port=9306,master_user='root'; reset slave; !change master to master_host='127.0.0.1',master_port=9306,master_user='root'; +connection master; +reset master; +connection slave; slave start; connection master; drop table if exists t1; @@ -18,7 +21,7 @@ insert into t1 values('Could not break slave'),('Tried hard'); save_master_pos; connection slave; sync_with_master; -sleep 1; +show slave status; select * from t1; connection master; flush logs; @@ -27,14 +30,13 @@ create table t2(m int); insert into t2 values (34),(67),(123); flush logs; show master logs; -sleep 2; # If a slow machine purge master logs to 'master-bin.003'; show master logs; insert into t2 values (65); save_master_pos; connection slave; sync_with_master; -sleep 1; +show slave status; select * from t2; drop table if exists t1,t2; connection master; diff --git a/sql/slave.cc b/sql/slave.cc index 73ba6242a27..667440e4026 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -616,7 +616,7 @@ int st_master_info::wait_for_pos(THD* thd, String* log_name, ulong log_pos) bool pos_reached; int event_count = 0; pthread_mutex_lock(&lock); - do + while(!thd->killed) { int cmp_result; if (*log_file_name) @@ -638,15 +638,13 @@ int st_master_info::wait_for_pos(THD* thd, String* log_name, ulong log_pos) pos_reached = ((!cmp_result && pos >= log_pos) || cmp_result > 0); if (pos_reached || thd->killed) break; - { - const char* msg = thd->enter_cond(&cond, &lock, - "Waiting for master update"); - pthread_cond_wait(&cond, &lock); - thd->exit_cond(msg); - event_count++; - pos_reached = (pos >= log_pos); - } - } while (!pos_reached && !thd->killed); + + const char* msg = thd->enter_cond(&cond, &lock, + "Waiting for master update"); + pthread_cond_wait(&cond, &lock); + thd->exit_cond(msg); + event_count++; + } pthread_mutex_unlock(&lock); return thd->killed ? -1 : event_count; } |