Below is the list of changes that have just been committed into a local
5.0 repository of gbichot. When gbichot 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.1881 05/07/04 22:27:16 gbichot@stripped +5 -0
Making rpl_until more robust if machine is slow. Removing rpl_trunc_binlog
which is wrong now that slave recovers gracefully from a crashed binlog (thx Serg).
stat -> my_stat in my_copy.c so that failing stat() does not hang client connection.
mysys/my_copy.c
1.13 05/07/04 22:09:44 gbichot@stripped +10 -8
Using my_stat() instead of stat(). Reason is that my_stat() reports an error message if wanted (MY_WME),
which is critical for an error being sent to the client. Before this patch, a failing stat() caused
the client connection to hang (because error was not set because my_error was never called).
Adding an assertion to match the comment at the start of the function.
mysql-test/t/rpl_until.test
1.16 05/07/04 22:09:44 gbichot@stripped +6 -3
making test more robust if machine is slow. We still need to sleep before testing if slave SQL thread stopped, because otherwise it may not have started yet when we test for stop, then we would return too early. When we have "START SLAVE" wait a few secs until slave threads actually started well (WL#2688) these "sleep 2" could be removed.
mysql-test/std_data/trunc_binlog.000001
1.5 05/07/04 21:41:21 gbichot@stripped +0 -0
Rename: BitKeeper/deleted/.del-trunc_binlog.000001~b504d840c7efde25 -> mysql-test/std_data/trunc_binlog.000001
BitKeeper/deleted/.del-rpl_trunc_binlog.result~14b4a61886a332e8
1.16 05/07/04 14:55:24 gbichot@stripped +0 -0
Delete: mysql-test/r/rpl_trunc_binlog.result
BitKeeper/deleted/.del-rpl_trunc_binlog.test~961b1f6ac73d37c8
1.13 05/07/04 14:55:16 gbichot@stripped +0 -0
Delete: mysql-test/t/rpl_trunc_binlog.test
BitKeeper/deleted/.del-trunc_binlog.000001~b504d840c7efde25
1.4 05/07/04 14:55:11 gbichot@stripped +0 -0
Delete: mysql-test/std_data/trunc_binlog.000001
# 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: gbichot
# Host: production.mysql.com
# Root: /nfstmp1/guilhem/mysql-5.0-prod-gcc
--- 1.12/mysys/my_copy.c 2003-11-28 11:18:09 +01:00
+++ 1.13/mysys/my_copy.c 2005-07-04 22:09:44 +02:00
@@ -16,7 +16,7 @@
#define USES_TYPES /* sys/types is included */
#include "mysys_priv.h"
-#include <sys/stat.h>
+#include <my_dir.h> /* for stat */
#include <m_string.h>
#if defined(HAVE_UTIME_H)
#include <utime.h>
@@ -53,26 +53,28 @@
int my_copy(const char *from, const char *to, myf MyFlags)
{
uint Count;
- int new_file_stat, create_flag;
+ my_bool new_file_stat; /* 1 if we could stat "to" */
+ int create_flag;
File from_file,to_file;
char buff[IO_SIZE];
- struct stat stat_buff,new_stat_buff;
+ MY_STAT stat_buff,new_stat_buff;
DBUG_ENTER("my_copy");
DBUG_PRINT("my",("from %s to %s MyFlags %d", from, to, MyFlags));
from_file=to_file= -1;
- new_file_stat=0;
+ LINT_INIT(new_file_stat);
+ DBUG_ASSERT(!(MyFlags & (MY_FNABP | MY_NABP))); /* for my_read/my_write */
if (MyFlags & MY_HOLD_ORIGINAL_MODES) /* Copy stat if possible */
- new_file_stat=stat((char*) to, &new_stat_buff);
+ new_file_stat= test(my_stat((char*) to, &new_stat_buff, MYF(0)));
if ((from_file=my_open(from,O_RDONLY | O_SHARE,MyFlags)) >= 0)
{
- if (stat(from,&stat_buff))
+ if (!my_stat(from, &stat_buff, MyFlags))
{
my_errno=errno;
goto err;
}
- if (MyFlags & MY_HOLD_ORIGINAL_MODES && !new_file_stat)
+ if (MyFlags & MY_HOLD_ORIGINAL_MODES && new_file_stat)
stat_buff=new_stat_buff;
create_flag= (MyFlags & MY_DONT_OVERWRITE_FILE) ? O_EXCL : O_TRUNC;
@@ -91,7 +93,7 @@
/* Copy modes if possible */
- if (MyFlags & MY_HOLD_ORIGINAL_MODES && new_file_stat)
+ if (MyFlags & MY_HOLD_ORIGINAL_MODES && !new_file_stat)
DBUG_RETURN(0); /* File copyed but not stat */
VOID(chmod(to, stat_buff.st_mode & 07777)); /* Copy modes */
#if !defined(MSDOS) && !defined(__WIN__) && !defined(__EMX__) && !defined(OS2) && !defined(__NETWARE__)
--- 1.15/mysql-test/t/rpl_until.test 2005-03-25 14:51:04 +01:00
+++ 1.16/mysql-test/t/rpl_until.test 2005-07-04 22:09:44 +02:00
@@ -26,6 +26,7 @@
connection slave;
start slave until master_log_file='master-bin.000001', master_log_pos=319;
sleep 2;
+wait_for_slave_to_stop;
# here table should be still not deleted
select * from t1;
--replace_result $MASTER_MYPORT MASTER_MYPORT
@@ -37,13 +38,15 @@
# again this table should be still not deleted
select * from t1;
sleep 2;
+wait_for_slave_to_stop;
--replace_result $MASTER_MYPORT MASTER_MYPORT
--replace_column 1 # 9 # 23 # 33 #
show slave status;
# try replicate all until second insert to t2;
start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=746;
-sleep 4;
+sleep 2;
+wait_for_slave_to_stop;
select * from t2;
--replace_result $MASTER_MYPORT MASTER_MYPORT
--replace_column 1 # 9 # 23 # 33 #
@@ -59,8 +62,8 @@
# this should stop immediately as we are already there
start slave until master_log_file='master-bin.000001', master_log_pos=776;
-# 2 is not enough when running with valgrind
-real_sleep 4
+sleep 2;
+wait_for_slave_to_stop;
# here the sql slave thread should be stopped
--replace_result $MASTER_MYPORT MASTER_MYPORT bin.000005 bin.000004 bin.000006 bin.000004 bin.000007 bin.000004
--replace_column 1 # 9 # 23 # 33 #
| Thread |
|---|
| • bk commit into 5.0 tree (gbichot:1.1881) | guilhem | 4 Jul |