Commit 9330f85b authored by unknown's avatar unknown

temporary commit - need to pull Monty's changes


mysql-test/t/rpl000001.test:
  modified test to break current replicatioin on a large log with a large lag 
  in slave thread between append and read of the relay log
mysys/mf_iocache.c:
  fixed one bug in IO_CACHE but there is another one not fixed yet
sql/slave.cc:
  fixed bug in 3.23 master replication
parent 83666b3e
...@@ -27,21 +27,38 @@ sync_with_master; ...@@ -27,21 +27,38 @@ sync_with_master;
connection master; connection master;
reset master; reset master;
connection slave; connection slave;
slave stop;
reset slave; reset slave;
connection master; connection master;
drop table if exists t1,t2; drop table if exists t1,t2;
create table t1(n int); create table t1(n int);
let $1=10; #we want the log to exceed 16K to test deal with the log that is bigger than
#IO_SIZE
let $1=5000;
disable_query_log;
while ($1) while ($1)
{ {
eval insert into t1 values($1); eval insert into t1 values($1+get_lock("hold_slave",10)*0);
dec $1; dec $1;
} }
enable_query_log;
#try to cause a large relay log lag on the slave
connection slave;
select get_lock("hold_slave",10);
slave start;
#hope this is long enough for I/O thread to fetch over 16K relay log data
sleep 1;
select release_lock("hold_slave");
unlock tables;
connection master;
create table t2(id int); create table t2(id int);
insert into t2 values(connection_id()); insert into t2 values(connection_id());
save_master_pos; save_master_pos;
connection master1; connection master1;
#avoid generating result #avoid generating result
create temporary table t1_temp(n int); create temporary table t1_temp(n int);
...@@ -60,7 +77,7 @@ reap; ...@@ -60,7 +77,7 @@ reap;
connection slave; connection slave;
sync_with_master ; sync_with_master ;
#give the slave a chance to exit #give the slave a chance to exit
sleep 0.5; wait_for_slave_to_stop;
# The following test can't be done because the result of Pos will differ # The following test can't be done because the result of Pos will differ
# on different computers # on different computers
......
...@@ -823,6 +823,7 @@ int my_b_append(register IO_CACHE *info, const byte *Buffer, uint Count) ...@@ -823,6 +823,7 @@ int my_b_append(register IO_CACHE *info, const byte *Buffer, uint Count)
} }
Count-=length; Count-=length;
Buffer+=length; Buffer+=length;
info->end_of_file+=length;
} }
end: end:
......
...@@ -1999,7 +1999,7 @@ static int queue_old_event(MASTER_INFO* mi, const char* buf, ...@@ -1999,7 +1999,7 @@ static int queue_old_event(MASTER_INFO* mi, const char* buf,
mi->master_log_pos += event_len; mi->master_log_pos += event_len;
if (unlikely(processed_stop_event)) if (unlikely(processed_stop_event))
mi->ignore_stop_event=1; mi->ignore_stop_event=1;
pthread_mutex_lock(&mi->data_lock); pthread_mutex_unlock(&mi->data_lock);
return 0; return 0;
} }
......
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