Commit 1b049d16 authored by unknown's avatar unknown

Merge work:/home/bk/mysql-4.0

into mysql.sashanet.com:/reiser-data/mysql-4.0


sql/mysqld.cc:
  Auto merged
parents 4e26a50e d90d3bca
......@@ -8,7 +8,7 @@ File Position Binlog_do_db Binlog_ignore_db
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 Relay_log_space
127.0.0.1 root MASTER_PORT 1 master-bin.001 79 slave-relay-bin.002 120 master-bin.001 Yes Yes 0 0 79 124
127.0.0.1 root MASTER_PORT 1 master-bin.001 79 slave-relay-bin.002 120 master-bin.001 Yes Yes 0 0 79 128
change master to master_log_pos=73;
slave stop;
change master to master_log_pos=73;
......
......@@ -75,7 +75,7 @@ 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 Relay_log_space
127.0.0.1 root MASTER_PORT 1 master-bin.002 170 slave-relay-bin.002 916 master-bin.002 Yes Yes 0 0 170 920
127.0.0.1 root MASTER_PORT 1 master-bin.002 170 slave-relay-bin.002 916 master-bin.002 Yes Yes 0 0 170 924
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
......
......@@ -227,6 +227,11 @@ SHOW_COMP_OPTION have_query_cache=SHOW_OPTION_NO;
#endif
bool opt_skip_slave_start = 0; // If set, slave is not autostarted
/* if set, some standard measures to enforce
slave data intergity will not be performed
*/
bool opt_reckless_slave = 0;
static bool opt_do_pstack = 0;
static ulong opt_specialflag=SPECIAL_ENGLISH;
static ulong back_log,connect_timeout,concurrency;
......@@ -2741,6 +2746,7 @@ enum options {
OPT_RPL_RECOVERY_RANK,OPT_INIT_RPL_ROLE,
OPT_RELAY_LOG, OPT_RELAY_LOG_INDEX, OPT_RELAY_LOG_INFO_FILE,
OPT_SLAVE_SKIP_ERRORS, OPT_DES_KEY_FILE, OPT_LOCAL_INFILE,
OPT_RECKLESS_SLAVE,
OPT_SSL_SSL, OPT_SSL_KEY, OPT_SSL_CERT, OPT_SSL_CA,
OPT_SSL_CAPATH, OPT_SSL_CIPHER
};
......@@ -2851,6 +2857,7 @@ static struct option long_options[] = {
#endif
{"pid-file", required_argument, 0, (int) OPT_PID_FILE},
{"port", required_argument, 0, 'P'},
{"reckless-slave", no_argument, 0, (int) OPT_RECKLESS_SLAVE},
{"replicate-do-db", required_argument, 0, (int) OPT_REPLICATE_DO_DB},
{"replicate-do-table", required_argument, 0,
(int) OPT_REPLICATE_DO_TABLE},
......@@ -3941,6 +3948,10 @@ static void get_options(int argc,char **argv)
opt_slow_log=1;
opt_slow_logname=optarg;
break;
case (int)OPT_RECKLESS_SLAVE:
opt_reckless_slave = 1;
init_slave_skip_errors("all");
break;
case (int)OPT_SKIP_SLAVE_START:
opt_skip_slave_start = 1;
break;
......
......@@ -191,11 +191,22 @@ int init_relay_log_pos(RELAY_LOG_INFO* rli,const char* log,
pos = rli->relay_log_pos; // already inited
else
rli->relay_log_pos = pos;
if (rli->relay_log.find_first_log(&rli->linfo,log))
// test to see if the previous run was with the skip of purging
// if yes, we do not purge when we restart
if (rli->relay_log.find_first_log(&rli->linfo,""))
{
*errmsg="Could not find first log during relay log initialization";
goto err;
}
if (strcmp(log,rli->linfo.log_file_name))
rli->skip_log_purge=1;
if (rli->relay_log.find_first_log(&rli->linfo,log))
{
*errmsg="Could not find target log during relay log initialization";
goto err;
}
strnmov(rli->relay_log_name,rli->linfo.log_file_name,
sizeof(rli->relay_log_name));
// to make end_io_cache(&rli->cache_buf) safe in all cases
......@@ -2497,6 +2508,15 @@ Log_event* next_event(RELAY_LOG_INFO* rli)
return ev;
}
DBUG_ASSERT(thd==rli->sql_thd);
if (opt_reckless_slave)
cur_log->error = 0;
if ( cur_log->error < 0)
{
errmsg = "slave SQL thread aborted because of I/O error";
goto err;
}
if (!cur_log->error) /* EOF */
{
/*
......@@ -2605,12 +2625,12 @@ event(errno=%d,cur_log->error=%d)",
my_errno,cur_log->error);
// set read position to the beginning of the event
my_b_seek(cur_log,rli->relay_log_pos+rli->pending);
// no need to hog the mutex while we sleep
pthread_mutex_unlock(&rli->data_lock);
safe_sleep(rli->sql_thd,1,(CHECK_KILLED_FUNC)sql_slave_killed,
(void*)rli);
pthread_mutex_lock(&rli->data_lock);
/* otherwise, we have had a partial read */
/* TODO; see if there is a way to do this without this goto */
errmsg = "Aborting slave SQL thread because of partial event read";
goto err;
}
}
if (!errmsg && was_killed)
errmsg = "slave SQL thread was killed";
......
......@@ -30,7 +30,7 @@ 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;
extern bool opt_skip_slave_start, opt_reckless_slave;
extern ulong relay_log_space_limit;
struct st_master_info;
......
This diff is collapsed.
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