List:Internals« Previous MessageNext Message »
From:sasha Date:January 22 2002 10:05pm
Subject:bk commit into 4.0 tree
View as plain text  
Below is the list of changes that have just been committed into a
4.0 repository of sasha. When sasha does a push, they will be propogated 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://www.mysql.com/doc/I/n/Installing_source_tree.html

ChangeSet@stripped, 2002-01-22 15:05:11-07:00, sasha@stripped
  post-merge fixes, including slave-skip-errors backport
  fixed too quick timeout in mysql-test-run which caused a race with the
   new server getting started before the old one completely finished 
   shutdown. This should fix the pid warning we've been getting as well as
   inconsistent results when running tests with the manager

  libmysqld/lib_sql.cc
    1.22 02/01/22 15:05:10 sasha@stripped +0 -8
    post-merge fix

  mysql-test/mysql-test-run.sh
    1.141 02/01/22 15:05:10 sasha@stripped +5 -5
    fixed start/stop timeout and cleanup of log directory

  mysql-test/r/rpl000014.result
    1.15 02/01/22 15:05:10 sasha@stripped +4 -4
    post-merge fix

  mysql-test/r/rpl000015.result
    1.16 02/01/22 15:05:10 sasha@stripped +4 -4
    post-merge fix

  mysql-test/r/rpl000016.result
    1.22 02/01/22 15:05:10 sasha@stripped +5 -5
    post-merge fix

  mysql-test/r/rpl_log.result
    1.21 02/01/22 15:05:10 sasha@stripped +4 -17
    post-merge fix

  sql/log_event.cc
    1.72 02/01/22 15:05:10 sasha@stripped +9 -2
    post-merge fix

  sql/slave.cc
    1.147 02/01/22 15:05:10 sasha@stripped +33 -0
    post-merge fix

  sql/slave.h
    1.29 02/01/22 15:05:10 sasha@stripped +6 -0
    post-merge fix

  sql/sql_class.h
    1.107 02/01/22 15:05:10 sasha@stripped +0 -1
    post-merge fix

  tools/mysqlmanager.c
    1.30 02/01/22 15:05:10 sasha@stripped +1 -1
    added debug message

# 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:	sasha
# Host:	mysql.sashanet.com
# Root:	/reiser-data/mysql-4.0

--- 1.140/mysql-test/mysql-test-run.sh	Sat Dec 22 18:03:08 2001
+++ 1.141/mysql-test/mysql-test-run.sh	Tue Jan 22 15:05:10 2002
@@ -149,6 +149,7 @@
 RES_SPACE="      "
 MYSQLD_SRC_DIRS="strings mysys include extra regex isam merge myisam \
  myisammrg heap sql"
+MY_LOG_DIR="$MYSQL_TEST_DIR/var/log" 
 #
 # Set LD_LIBRARY_PATH if we are using shared libraries
 #
@@ -181,8 +182,8 @@
 SLEEP_TIME_FOR_SECOND_SLAVE=30
 CHARACTER_SET=latin1
 DBUSER=""
-START_WAIT_TIMEOUT=3
-STOP_WAIT_TIMEOUT=3
+START_WAIT_TIMEOUT=10
+STOP_WAIT_TIMEOUT=10
 
 while test $# -gt 0; do
   case "$1" in
@@ -521,7 +522,7 @@
 	deci=`$EXPR $raw - $xwhole`
 	$ECHO  "Failed ${TOT_FAIL}/${TOT_TEST} tests, ${whole}.${deci}% successful."
 	$ECHO ""
-        $ECHO "The log files in $MYSQL_TEST_DIR/var/log may give you some hint"
+        $ECHO "The log files in $MY_LOG_DIR may give you some hint"
 	$ECHO "of what when wrong."
 	$ECHO "If you want to report this error, please read first the documentation at"
         $ECHO "http://www.mysql.com/doc/M/y/MySQL_test_suite.html"
@@ -530,8 +531,7 @@
 
 mysql_install_db () {
     $ECHO "Removing Stale Files"
-    $RM -rf $MASTER_MYDDIR $SLAVE_MYDDIR $SLAVE_MYLOG $MASTER_MYLOG \
-     $SLAVE_MYERR $MASTER_MYERR
+    $RM -rf $MASTER_MYDDIR $SLAVE_MYDDIR $MY_LOG_DIR/* 
     $ECHO "Installing Master Databases"
     $INSTALL_DB
     if [ $? != 0 ]; then

--- 1.71/sql/log_event.cc	Sat Jan 19 22:46:23 2002
+++ 1.72/sql/log_event.cc	Tue Jan 22 15:05:10 2002
@@ -53,6 +53,11 @@
 
 #ifndef MYSQL_CLIENT
 
+inline int ignored_error_code(int err_code)
+{
+  return use_slave_mask && bitmap_is_set(&slave_error_mask, err_code);
+}
+
 
 static void pretty_print_str(String* packet, char* str, int len)
 {
@@ -1564,7 +1569,8 @@
 	
     // sanity check to make sure the master did not get a really bad
     // error on the query
-    if (!check_expected_error(thd,rli,(expected_error = error_code)))
+    if (ignored_error_code((expected_error = error_code)) ||
+	!check_expected_error(thd,rli,expected_error))
     {
       mysql_parse(thd, thd->query, q_len);
       if (expected_error !=
@@ -1578,7 +1584,8 @@
 			actual_error);
 	thd->query_error = 1;
       }
-      else if (expected_error == actual_error)
+      else if (expected_error == actual_error
+	       || ignored_error_code(actual_error))
       {
 	thd->query_error = 0;
 	*rli->last_slave_error = 0;

--- 1.146/sql/slave.cc	Sat Jan 19 22:46:23 2002
+++ 1.147/sql/slave.cc	Tue Jan 22 15:05:10 2002
@@ -26,6 +26,9 @@
 #include <my_dir.h>
 #include <assert.h>
 
+bool use_slave_mask = 0;
+MY_BITMAP slave_error_mask;
+
 volatile bool slave_sql_running = 0, slave_io_running = 0;
 char* slave_load_tmpdir = 0;
 MASTER_INFO main_mi;
@@ -217,6 +220,36 @@
    pthread_mutex_unlock(&rli->data_lock);
  pthread_mutex_unlock(log_lock);
  return (*errmsg) ? 1 : 0;
+}
+
+/* called from get_options() in mysqld.cc on start-up */
+void init_slave_skip_errors(char* arg)
+{
+  char* p;
+  my_bool last_was_digit = 0;
+  if (bitmap_init(&slave_error_mask,MAX_SLAVE_ERROR,0))
+  {
+    fprintf(stderr, "Badly out of memory, please check your system status\n");
+    exit(1);
+  }
+  use_slave_mask = 1;
+  for (;isspace(*arg);++arg)
+    /* empty */;
+  if (!my_casecmp(arg,"all",3))
+  {
+    bitmap_set_all(&slave_error_mask);
+    return;
+  }
+  for (p= arg ; *p; )
+  {
+    long err_code;
+    if (!(p= str2int(p, 10, 0, LONG_MAX, &err_code)))
+      break;
+    if (err_code < MAX_SLAVE_ERROR)
+       bitmap_set_bit(&slave_error_mask,(uint)err_code);
+    while (!isdigit(*p) && *p)
+      p++;
+  }
 }
 
 // we assume we have a run lock on rli and that the both slave thread

--- 1.106/sql/sql_class.h	Sat Jan 19 22:46:23 2002
+++ 1.107/sql/sql_class.h	Tue Jan 22 15:05:10 2002
@@ -312,7 +312,6 @@
   struct st_my_thread_var *mysys_var;
   enum enum_server_command command;
   uint32 server_id;
-  uint32 file_id; // for LOAD DATA INFILE
   uint32     file_id;			// for LOAD DATA INFILE
   const char *where;
   time_t     start_time,time_after_lock,user_time;

--- 1.21/libmysqld/lib_sql.cc	Sat Jan 19 19:22:42 2002
+++ 1.22/libmysqld/lib_sql.cc	Tue Jan 22 15:05:10 2002
@@ -402,9 +402,6 @@
   (void) pthread_mutex_init(&LOCK_bytes_sent,MY_MUTEX_INIT_FAST);
   (void) pthread_mutex_init(&LOCK_bytes_received,MY_MUTEX_INIT_FAST);
   (void) pthread_mutex_init(&LOCK_timezone,MY_MUTEX_INIT_FAST);
-  (void) pthread_mutex_init(&LOCK_slave_io, MY_MUTEX_INIT_FAST);
-  (void) pthread_mutex_init(&LOCK_slave_sql, MY_MUTEX_INIT_FAST);
-  (void) pthread_mutex_init(&LOCK_server_id, MY_MUTEX_INIT_FAST);
   (void) pthread_mutex_init(&LOCK_user_conn, MY_MUTEX_INIT_FAST);
   (void) pthread_cond_init(&COND_thread_count,NULL);
   (void) pthread_cond_init(&COND_refresh,NULL);
@@ -412,11 +409,6 @@
   (void) pthread_cond_init(&COND_flush_thread_cache,NULL);
   (void) pthread_cond_init(&COND_manager,NULL);
   (void) pthread_cond_init(&COND_binlog_update, NULL);
-  (void) pthread_cond_init(&COND_slave_log_update, NULL);
-  (void) pthread_cond_init(&COND_slave_sql_stop, NULL);
-  (void) pthread_cond_init(&COND_slave_sql_start, NULL);
-  (void) pthread_cond_init(&COND_slave_sql_stop, NULL);
-  (void) pthread_cond_init(&COND_slave_sql_start, NULL);
 
   if (set_default_charset_by_name(default_charset, MYF(MY_WME)))
   {

--- 1.28/sql/slave.h	Sat Jan 19 22:46:23 2002
+++ 1.29/sql/slave.h	Tue Jan 22 15:05:10 2002
@@ -5,6 +5,7 @@
 #include "my_list.h"
 #define SLAVE_NET_TIMEOUT  3600
 #define MAX_SLAVE_ERRMSG   1024
+#define MAX_SLAVE_ERROR    2000
 
 /*
   The replication is accomplished by starting two threads - I/O
@@ -24,12 +25,16 @@
  */
 
 extern ulong slave_net_timeout, master_retry_count;
+extern MY_BITMAP slave_error_mask;
+extern bool use_slave_mask;
 extern char* slave_load_tmpdir;
 extern my_string master_info_file,relay_log_info_file;
 extern my_string opt_relay_logname, opt_relaylog_index_name;
 extern bool opt_skip_slave_start;
 struct st_master_info;
 
+// TODO: this needs to be redone, but for now it does not matter since
+// we do not have multi-master yet.
 #define LOCK_ACTIVE_MI { pthread_mutex_lock(&LOCK_active_mi); \
  ++active_mi_in_use; \
  pthread_mutex_unlock(&LOCK_active_mi);}
@@ -286,6 +291,7 @@
 				*/
 
 int init_slave();
+void init_slave_skip_errors(char* arg);
 int flush_master_info(MASTER_INFO* mi);
 int flush_relay_log_info(RELAY_LOG_INFO* rli);
 int register_slave_on_master(MYSQL* mysql);

--- 1.14/mysql-test/r/rpl000014.result	Sat Jan 19 22:46:23 2002
+++ 1.15/mysql-test/r/rpl000014.result	Tue Jan 22 15:05:10 2002
@@ -8,21 +8,21 @@
 master-bin.001	79		
 show slave status;
 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	Last_errno	Last_error	Skip_counter	Exec_master_log_pos
-127.0.0.1	root	9306	1	master-bin.001	79	mysql-relay-bin.002	120	master-bin.001	Yes	Yes			0		0	79
+127.0.0.1	root	MASTER_PORT	1	master-bin.001	79	mysql-relay-bin.002	120	master-bin.001	Yes	Yes			0		0	79
 change master to master_log_pos=73;
 slave stop;
 change master to master_log_pos=73;
 show slave status;
 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	Last_errno	Last_error	Skip_counter	Exec_master_log_pos
-127.0.0.1	root	9306	1	master-bin.001	73	mysql-relay-bin.001	4	master-bin.001	No	No			0		0	73
+127.0.0.1	root	MASTER_PORT	1	master-bin.001	73	mysql-relay-bin.001	4	master-bin.001	No	No			0		0	73
 slave start;
 show slave status;
 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	Last_errno	Last_error	Skip_counter	Exec_master_log_pos
-127.0.0.1	root	9306	1	master-bin.001	73	mysql-relay-bin.001	4	master-bin.001	Yes	Yes			0		0	73
+127.0.0.1	root	MASTER_PORT	1	master-bin.001	73	mysql-relay-bin.001	4	master-bin.001	Yes	Yes			0		0	73
 change master to master_log_pos=173;
 show slave status;
 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	Last_errno	Last_error	Skip_counter	Exec_master_log_pos
-127.0.0.1	root	9306	1	master-bin.001	173	mysql-relay-bin.001	4	master-bin.001	Yes	Yes			0		0	173
+127.0.0.1	root	MASTER_PORT	1	master-bin.001	173	mysql-relay-bin.001	4	master-bin.001	Yes	Yes			0		0	173
 show master status;
 File	Position	Binlog_do_db	Binlog_ignore_db
 master-bin.001	79		

--- 1.15/mysql-test/r/rpl000015.result	Sat Jan 19 22:46:23 2002
+++ 1.16/mysql-test/r/rpl000015.result	Tue Jan 22 15:05:10 2002
@@ -9,16 +9,16 @@
 change master to master_host='127.0.0.1';
 show slave status;
 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	Last_errno	Last_error	Skip_counter	Exec_master_log_pos
-127.0.0.1	test	3306	60		4	mysql-relay-bin.001	4		No	No			0		0	0
+127.0.0.1	test	MASTER_PORT	60		4	mysql-relay-bin.001	4		No	No			0		0	0
 change master to master_host='127.0.0.1',master_user='root',
-master_password='',master_port=9306;
+master_password='',master_port=MASTER_PORT;
 show slave status;
 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	Last_errno	Last_error	Skip_counter	Exec_master_log_pos
-127.0.0.1	root	9306	60		4	mysql-relay-bin.001	4		No	No			0		0	0
+127.0.0.1	root	MASTER_PORT	60		4	mysql-relay-bin.001	4		No	No			0		0	0
 slave start;
 show slave status;
 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	Last_errno	Last_error	Skip_counter	Exec_master_log_pos
-127.0.0.1	root	9306	60	master-bin.001	79	mysql-relay-bin.001	120	master-bin.001	Yes	Yes			0		0	79
+127.0.0.1	root	MASTER_PORT	60	master-bin.001	79	mysql-relay-bin.001	120	master-bin.001	Yes	Yes			0		0	79
 drop table if exists t1;
 create table t1 (n int);
 insert into t1 values (10),(45),(90);

--- 1.21/mysql-test/r/rpl000016.result	Sat Jan 19 22:46:23 2002
+++ 1.22/mysql-test/r/rpl000016.result	Tue Jan 22 15:05:10 2002
@@ -2,11 +2,11 @@
 Could not initialize master info structure, check permisions on master.info
 slave start;
 Could not initialize master info structure, check permisions on master.info
-change master to master_host='127.0.0.1',master_port=9306,
+change master to master_host='127.0.0.1',master_port=MASTER_PORT,
 master_user='root';
 Could not initialize master info
 reset slave;
-change master to master_host='127.0.0.1',master_port=9306,
+change master to master_host='127.0.0.1',master_port=MASTER_PORT,
 master_user='root';
 reset master;
 slave start;
@@ -15,7 +15,7 @@
 insert into t1 values('Could not break slave'),('Tried hard');
 show slave status;
 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	Last_errno	Last_error	Skip_counter	Exec_master_log_pos
-127.0.0.1	root	9306	60	master-bin.001	234	mysql-relay-bin.001	275	master-bin.001	Yes	Yes			0		0	234
+127.0.0.1	root	MASTER_PORT	60	master-bin.001	234	mysql-relay-bin.001	275	master-bin.001	Yes	Yes			0		0	234
 select * from t1;
 s
 Could not break slave
@@ -43,7 +43,7 @@
 insert into t2 values (65);
 show slave status;
 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	Last_errno	Last_error	Skip_counter	Exec_master_log_pos
-127.0.0.1	root	9306	60	master-bin.003	155	mysql-relay-bin.001	793	master-bin.003	Yes	Yes			0		0	155
+127.0.0.1	root	MASTER_PORT	60	master-bin.003	155	mysql-relay-bin.001	793	master-bin.003	Yes	Yes			0		0	155
 select * from t2;
 m
 34
@@ -66,7 +66,7 @@
 slave start;
 show slave status;
 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	Last_errno	Last_error	Skip_counter	Exec_master_log_pos
-127.0.0.1	root	9306	60	master-bin.006	445	mysql-relay-bin.004	1376	master-bin.006	Yes	Yes			0		0	445
+127.0.0.1	root	MASTER_PORT	60	master-bin.006	445	mysql-relay-bin.004	1312	master-bin.006	Yes	Yes			0		0	445
 lock tables t3 read;
 select count(*) from t3 where n >= 4;
 count(*)

--- 1.20/mysql-test/r/rpl_log.result	Sat Jan 19 22:46:23 2002
+++ 1.21/mysql-test/r/rpl_log.result	Tue Jan 22 15:05:10 2002
@@ -16,7 +16,7 @@
 drop table t1;
 show binlog events;
 Log_name	Pos	Event_type	Server_id	Orig_log_pos	Info
-master-bin.001	4	Start	1	4	Server ver: 4.0.1-alpha-debug-log, Binlog ver: 3
+master-bin.001	4	Start	1	4	Server ver: VERSION, Binlog ver: 3
 master-bin.001	79	Query	1	79	use test; create table t1(n int not null auto_increment primary key)
 master-bin.001	172	Intvar	1	172	INSERT_ID=1
 master-bin.001	200	Query	1	200	use test; insert into t1 values (NULL)
@@ -41,7 +41,7 @@
 drop table t1;
 show binlog events;
 Log_name	Pos	Event_type	Server_id	Orig_log_pos	Info
-master-bin.001	4	Start	1	4	Server ver: 4.0.1-alpha-debug-log, Binlog ver: 3
+master-bin.001	4	Start	1	4	Server ver: VERSION, Binlog ver: 3
 master-bin.001	79	Query	1	79	use test; create table t1(n int not null auto_increment primary key)
 master-bin.001	172	Intvar	1	172	INSERT_ID=1
 master-bin.001	200	Query	1	200	use test; insert into t1 values (NULL)
@@ -67,28 +67,15 @@
 slave-bin.001
 slave-bin.002
 show binlog events in 'slave-bin.001' from 4;
-Log_name	Pos	Event_type	Server_id	Orig_log_pos	Info
-slave-bin.001	4	Start	2	4	Server ver: 4.0.1-alpha-debug-log, Binlog ver: 3
-slave-bin.001	79	Slave	2	79	host=127.0.0.1,port=9306,log=master-bin.001,pos=4
-slave-bin.001	132	Query	1	79	use test; create table t1(n int not null auto_increment primary key)
-slave-bin.001	225	Intvar	1	200	INSERT_ID=1
-slave-bin.001	253	Query	1	200	use test; insert into t1 values (NULL)
-slave-bin.001	316	Query	1	263	use test; drop table t1
-slave-bin.001	364	Query	1	311	use test; create table t1 (word char(20) not null)
-slave-bin.001	439	Create_file	1	386	db=test;table=t1;file_id=1;block_len=81
-slave-bin.001	618	Exec_load	1	556	;file_id=1
-slave-bin.001	641	Query	1	579	use test; drop table t1
-slave-bin.001	689	Rotate	1	627	slave-bin.002;pos=4; forced by master
-slave-bin.001	729	Stop	2	729	
 show binlog events in 'slave-bin.002' from 4;
 Log_name	Pos	Event_type	Server_id	Orig_log_pos	Info
-slave-bin.002	4	Slave	2	627	host=127.0.0.1,port=9306,log=master-bin.002,pos=4
+slave-bin.002	4	Slave	2	627	host=127.0.0.1,port=MASTER_PORT,log=master-bin.002,pos=4
 slave-bin.002	57	Query	1	4	use test; create table t1 (n int)
 slave-bin.002	115	Query	1	62	use test; insert into t1 values (1)
 slave-bin.002	175	Query	1	122	use test; drop table t1
 show slave status;
 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	Last_errno	Last_error	Skip_counter	Exec_master_log_pos
-127.0.0.1	root	9306	1	master-bin.002	170	mysql-relay-bin.002	935	master-bin.002	Yes	Yes			0		0	170
+127.0.0.1	root	MASTER_PORT	1	master-bin.002	170	mysql-relay-bin.002	935	master-bin.002	Yes	Yes			0		0	170
 show new master for slave with master_log_file='master-bin.001' and
 master_log_pos=4 and  master_server_id=1;
 Log_name	Log_pos

--- 1.29/tools/mysqlmanager.c	Sun Dec 16 18:02:57 2001
+++ 1.30/tools/mysqlmanager.c	Tue Jan 22 15:05:10 2002
@@ -1155,7 +1155,7 @@
     p=buf_end - 2;
   *p++='\r';
   *p++='\n';
-
+  log_debug("message to client: %-.*s",p-buf-2,buf);
   if (my_net_write(net,buf,(uint)(p-buf)) || net_flush(net))
   {
     p[-2]=0;
Thread
bk commit into 4.0 treesasha22 Jan