From 8bc2d722d35c20b820a4604610db49d8c7bd8dd0 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 20 Aug 2003 03:38:31 +0400 Subject: Fix for BUG#1086. Now we don't preserve event's log_pos through log-slave-updates since this causes unexpected values in Exec_master_log_pos in A->B->C replication setup, synchronization problems in master_pos_wait()... Still this brokes some functionality in sql/repl_failsafe.cc (but this file is not used now) mysql-test/r/rpl_log.result: SHOW BINLOG EVENTS for binlog on slave should give the same Orig_log_pos and Pos values sql/log_event.cc: Do not propagate our master's log pos to our bin log sql/repl_failsafe.cc: Added comment about broken SHOW NEW MASTER sql/slave.cc: Do not propagate our master's log pos to our bin log sql/sql_class.cc: THD::log_pos is no longer needed sql/sql_class.h: THD::log_pos is no longer needed sql/sql_parse.cc: Added comment about broken SHOW NEW MASTER --- sql/slave.cc | 1 - 1 file changed, 1 deletion(-) (limited to 'sql/slave.cc') diff --git a/sql/slave.cc b/sql/slave.cc index 85a9bc0d49e..145144072c9 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -2253,7 +2253,6 @@ static int exec_relay_log_event(THD* thd, RELAY_LOG_INFO* rli) if (!ev->when) ev->when = time(NULL); ev->thd = thd; - thd->log_pos = ev->log_pos; exec_res = ev->exec_event(rli); DBUG_ASSERT(rli->sql_thd==thd); delete ev; -- cgit v1.2.1 From 03de2bec96a4cfdad256ae11a58c4978d0e54c6d Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 20 Aug 2003 23:24:45 +0200 Subject: First commit for fixing BUG#1100 "LOAD DATA INFILE is badly filtered by binlog-*-db rules". There will probably be a second final one to merge Dmitri's changes to rpl_log.result and mine. 2 new tests: rpl_loaddata_rule_m : test of logging of LOAD DATA INFILE when the master has binlog-*-db rules, rpl_loaddata_rule_s : test of logging of LOAD DATA INFILE when the slave has binlog-*-db rules and --log-slave-updates. mysql-test/r/rpl_loaddata.result: Test that logging of LOAD DATA INFILE is done on the slave mysql-test/t/rpl_loaddata.test: Test that logging of LOAD DATA is done on the slave sql/log.cc: debug info sql/log_event.cc: * Append_block, Exec_load and Delete_file now have a member 'db' like Create_file. This member is filled by mysql_load(). It is used for filtering by binlog-*-db rules, that's all. It's not written to the binlog, and so can't be read from the binlog. In other words, that's temporary info which is stored in the event and lost when it is written and deleted. * Better error messages in Append_block et al. events. * The slave now logs (log-slave-updates) the Create_file et al. events in mysql_load() (they are not directly copied from the events in the relay log, because this prevented filtering by binlog-*-db rules). Before, mysql_load() in the slave did no logging, now it does the logging, as in any regular thread. sql/log_event.h: New member 'db' for Append_block et al. events. sql/slave.cc: Removed useless code. Why was it useless: - CREATE_FILE_EVENT is not defined in 3.23. It appeared in 4.0. - in queue_old_event(), which is called only if the master is 3.23, we had a case CREATE_FILE_EVENT: so this case can be removed. - this case was the only caller of process_io_create_file() so this function can be removed. sql/sql_load.cc: Pass the db to events, so that they can be well filtered. sql/sql_repl.cc: Pass the db to events so that they can be well filtered. --- sql/slave.cc | 109 ----------------------------------------------------------- 1 file changed, 109 deletions(-) (limited to 'sql/slave.cc') diff --git a/sql/slave.cc b/sql/slave.cc index 85a9bc0d49e..66a875b158f 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -57,7 +57,6 @@ typedef enum { SLAVE_THD_IO, SLAVE_THD_SQL} SLAVE_THD_TYPE; void skip_load_data_infile(NET* net); static int process_io_rotate(MASTER_INFO* mi, Rotate_log_event* rev); -static int process_io_create_file(MASTER_INFO* mi, Create_file_log_event* cev); static bool wait_for_relay_log_space(RELAY_LOG_INFO* rli); static inline bool io_slave_killed(THD* thd,MASTER_INFO* mi); static inline bool sql_slave_killed(THD* thd,RELAY_LOG_INFO* rli); @@ -2730,102 +2729,6 @@ the slave SQL thread with \"SLAVE START\". We stopped at log \ } -static int process_io_create_file(MASTER_INFO* mi, Create_file_log_event* cev) -{ - int error = 1; - ulong num_bytes; - bool cev_not_written; - THD* thd; - NET* net = &mi->mysql->net; - DBUG_ENTER("process_io_create_file"); - - if (unlikely(!cev->is_valid())) - DBUG_RETURN(1); - /* - TODO: fix to honor table rules, not only db rules - */ - if (!db_ok(cev->db, replicate_do_db, replicate_ignore_db)) - { - skip_load_data_infile(net); - DBUG_RETURN(0); - } - DBUG_ASSERT(cev->inited_from_old); - thd = mi->io_thd; - thd->file_id = cev->file_id = mi->file_id++; - thd->server_id = cev->server_id; - cev_not_written = 1; - - if (unlikely(net_request_file(net,cev->fname))) - { - sql_print_error("Slave I/O: failed requesting download of '%s'", - cev->fname); - goto err; - } - - /* - This dummy block is so we could instantiate Append_block_log_event - once and then modify it slightly instead of doing it multiple times - in the loop - */ - { - Append_block_log_event aev(thd,0,0,0); - - for (;;) - { - if (unlikely((num_bytes=my_net_read(net)) == packet_error)) - { - sql_print_error("Network read error downloading '%s' from master", - cev->fname); - goto err; - } - if (unlikely(!num_bytes)) /* eof */ - { - send_ok(net); /* 3.23 master wants it */ - Execute_load_log_event xev(thd,0); - xev.log_pos = mi->master_log_pos; - if (unlikely(mi->rli.relay_log.append(&xev))) - { - sql_print_error("Slave I/O: error writing Exec_load event to \ -relay log"); - goto err; - } - mi->rli.relay_log.harvest_bytes_written(&mi->rli.log_space_total); - break; - } - if (unlikely(cev_not_written)) - { - cev->block = (char*)net->read_pos; - cev->block_len = num_bytes; - cev->log_pos = mi->master_log_pos; - if (unlikely(mi->rli.relay_log.append(cev))) - { - sql_print_error("Slave I/O: error writing Create_file event to \ -relay log"); - goto err; - } - cev_not_written=0; - mi->rli.relay_log.harvest_bytes_written(&mi->rli.log_space_total); - } - else - { - aev.block = (char*)net->read_pos; - aev.block_len = num_bytes; - aev.log_pos = mi->master_log_pos; - if (unlikely(mi->rli.relay_log.append(&aev))) - { - sql_print_error("Slave I/O: error writing Append_block event to \ -relay log"); - goto err; - } - mi->rli.relay_log.harvest_bytes_written(&mi->rli.log_space_total) ; - } - } - } - error=0; -err: - DBUG_RETURN(error); -} - /* Start using a new binary log on the master @@ -2929,18 +2832,6 @@ static int queue_old_event(MASTER_INFO *mi, const char *buf, mi->ignore_stop_event=1; inc_pos= 0; break; - case CREATE_FILE_EVENT: - { - /* We come here when and only when tmp_buf != 0 */ - DBUG_ASSERT(tmp_buf); - int error = process_io_create_file(mi,(Create_file_log_event*)ev); - delete ev; - mi->master_log_pos += event_len; - DBUG_PRINT("info", ("master_log_pos: %d", (ulong) mi->master_log_pos)); - pthread_mutex_unlock(&mi->data_lock); - my_free((char*)tmp_buf, MYF(0)); - DBUG_RETURN(error); - } default: mi->ignore_stop_event=0; inc_pos= event_len; -- cgit v1.2.1 From dba0dcdd40a91965ff9265eb8b08b258709efee6 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 21 Aug 2003 10:24:37 +0200 Subject: Yesterday I removed process_io_create_file; I shouldn't have. Let's say the lack of comments did not help me ;) Copying it back again and adding comments; now 3.23->4.0 replication of LOAD DATA INFILE works again. sql/slave.cc: Enabling again process_io_create_file --- sql/slave.cc | 121 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 121 insertions(+) (limited to 'sql/slave.cc') diff --git a/sql/slave.cc b/sql/slave.cc index 9b5066f5804..32ed228e119 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -57,6 +57,7 @@ typedef enum { SLAVE_THD_IO, SLAVE_THD_SQL} SLAVE_THD_TYPE; void skip_load_data_infile(NET* net); static int process_io_rotate(MASTER_INFO* mi, Rotate_log_event* rev); +static int process_io_create_file(MASTER_INFO* mi, Create_file_log_event* cev); static bool wait_for_relay_log_space(RELAY_LOG_INFO* rli); static inline bool io_slave_killed(THD* thd,MASTER_INFO* mi); static inline bool sql_slave_killed(THD* thd,RELAY_LOG_INFO* rli); @@ -2728,6 +2729,102 @@ the slave SQL thread with \"SLAVE START\". We stopped at log \ } +static int process_io_create_file(MASTER_INFO* mi, Create_file_log_event* cev) +{ + int error = 1; + ulong num_bytes; + bool cev_not_written; + THD* thd; + NET* net = &mi->mysql->net; + DBUG_ENTER("process_io_create_file"); + + if (unlikely(!cev->is_valid())) + DBUG_RETURN(1); + /* + TODO: fix to honor table rules, not only db rules + */ + if (!db_ok(cev->db, replicate_do_db, replicate_ignore_db)) + { + skip_load_data_infile(net); + DBUG_RETURN(0); + } + DBUG_ASSERT(cev->inited_from_old); + thd = mi->io_thd; + thd->file_id = cev->file_id = mi->file_id++; + thd->server_id = cev->server_id; + cev_not_written = 1; + + if (unlikely(net_request_file(net,cev->fname))) + { + sql_print_error("Slave I/O: failed requesting download of '%s'", + cev->fname); + goto err; + } + + /* + This dummy block is so we could instantiate Append_block_log_event + once and then modify it slightly instead of doing it multiple times + in the loop + */ + { + Append_block_log_event aev(thd,0,0,0,0); + + for (;;) + { + if (unlikely((num_bytes=my_net_read(net)) == packet_error)) + { + sql_print_error("Network read error downloading '%s' from master", + cev->fname); + goto err; + } + if (unlikely(!num_bytes)) /* eof */ + { + send_ok(net); /* 3.23 master wants it */ + Execute_load_log_event xev(thd,0,0); + xev.log_pos = mi->master_log_pos; + if (unlikely(mi->rli.relay_log.append(&xev))) + { + sql_print_error("Slave I/O: error writing Exec_load event to \ +relay log"); + goto err; + } + mi->rli.relay_log.harvest_bytes_written(&mi->rli.log_space_total); + break; + } + if (unlikely(cev_not_written)) + { + cev->block = (char*)net->read_pos; + cev->block_len = num_bytes; + cev->log_pos = mi->master_log_pos; + if (unlikely(mi->rli.relay_log.append(cev))) + { + sql_print_error("Slave I/O: error writing Create_file event to \ +relay log"); + goto err; + } + cev_not_written=0; + mi->rli.relay_log.harvest_bytes_written(&mi->rli.log_space_total); + } + else + { + aev.block = (char*)net->read_pos; + aev.block_len = num_bytes; + aev.log_pos = mi->master_log_pos; + if (unlikely(mi->rli.relay_log.append(&aev))) + { + sql_print_error("Slave I/O: error writing Append_block event to \ +relay log"); + goto err; + } + mi->rli.relay_log.harvest_bytes_written(&mi->rli.log_space_total) ; + } + } + } + error=0; +err: + DBUG_RETURN(error); +} + /* Start using a new binary log on the master @@ -2803,6 +2900,12 @@ static int queue_old_event(MASTER_INFO *mi, const char *buf, tmp_buf[event_len]=0; // Create_file constructor wants null-term buffer buf = (const char*)tmp_buf; } + /* + This will transform LOAD_EVENT into CREATE_FILE_EVENT, ask the master to + send the loaded file, and write it to the relay log in the form of + Append_block/Exec_load (the SQL thread needs the data, as that thread is not + connected to the master). + */ Log_event *ev = Log_event::read_log_event(buf,event_len, &errmsg, 1 /*old format*/ ); if (unlikely(!ev)) @@ -2831,6 +2934,24 @@ static int queue_old_event(MASTER_INFO *mi, const char *buf, mi->ignore_stop_event=1; inc_pos= 0; break; + case CREATE_FILE_EVENT: + /* + Yes it's possible to have CREATE_FILE_EVENT here, even if we're in + queue_old_event() which is for 3.23 events which don't comprise + CREATE_FILE_EVENT. This is because read_log_event() above has just + transformed LOAD_EVENT into CREATE_FILE_EVENT. + */ + { + /* We come here when and only when tmp_buf != 0 */ + DBUG_ASSERT(tmp_buf); + int error = process_io_create_file(mi,(Create_file_log_event*)ev); + delete ev; + mi->master_log_pos += event_len; + DBUG_PRINT("info", ("master_log_pos: %d", (ulong) mi->master_log_pos)); + pthread_mutex_unlock(&mi->data_lock); + my_free((char*)tmp_buf, MYF(0)); + DBUG_RETURN(error); + } default: mi->ignore_stop_event=0; inc_pos= event_len; -- cgit v1.2.1 From a48480d74f7d4db7b5641615808dc0201192bed7 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 23 Aug 2003 16:53:04 +0200 Subject: * Fix for a potential bug: when the SQL thread stops, set rli->inside_transaction to 0. This is needed if the user later restarts replication from a completely different place where there are only autocommit statements. * Detect the case where the master died while flushing the binlog cache to the binlog and stop with error. Cannot add a testcase for this in 4.0 (I tested it manually) as the slave always runs with --skip-innodb. sql/log_event.cc: Detect the case where the master died while flushing the binlog cache to the binlog: in that case, we have a BEGIN with no COMMIT/ROLLBACK in the relay log; we detect this with rli->inside_transaction in Rotate_log_event::exec_event() (which is the only right place to detect this, see comments). When we see it, we stop with error. In 4.1, I had put code in Start_log_event::exec_event(); I'll remove it next time I push in the 4.1 tree. sql/slave.cc: * Use slave_print_error instead of sql_print_error, to put the info in SHOW SLAVE STATUS too. * Fix for a potential bug: when the SQL thread stops, set rli->inside_transaction to 0. This is not needed if replication later restarts from the same position; but this is needed if the user restarts replication from a completely different place where there are only autocommit statements (in that case, if we didn't set to 0, the position would never increment in SHOW SLAVE STATUS, even if queries are processed well). --- sql/slave.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'sql/slave.cc') diff --git a/sql/slave.cc b/sql/slave.cc index 32ed228e119..10ec0050d05 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -2260,7 +2260,7 @@ static int exec_relay_log_event(THD* thd, RELAY_LOG_INFO* rli) } else { - sql_print_error("\ + slave_print_error(rli, 0, "\ Could not parse relay log event entry. The possible reasons are: the master's \ binary log is corrupted (you can check this by running 'mysqlbinlog' on the \ binary log), the slave's relay log is corrupted (you can check this by running \ @@ -2695,6 +2695,12 @@ the slave SQL thread with \"SLAVE START\". We stopped at log \ DBUG_ASSERT(rli->slave_running == 1); // tracking buffer overrun /* When master_pos_wait() wakes up it will check this and terminate */ rli->slave_running= 0; + /* + Going out of the transaction. Necessary to mark it, in case the user + restarts replication from a non-transactional statement (with CHANGE + MASTER). + */ + rli->inside_transaction= 0; /* Wake up master_pos_wait() */ pthread_mutex_unlock(&rli->data_lock); DBUG_PRINT("info",("Signaling possibly waiting master_pos_wait() functions")); -- cgit v1.2.1 From e8a0027727950f83cccc8f9d99d6bbd520ef2a4b Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 23 Aug 2003 17:41:43 +0200 Subject: The slave threads MUST not care about max_join_size, we start them with OPTION_BIG_SELECTS. sql/slave.cc: The slave threads MUST not care about max_join_size. I can imagine the case of a slave where users can connect and do SELECTs, but DBA does not want them to issue crazy SELECTs, but he/she still wants replication to work. Before, this just printed a warning to the error log (not fatal) but that was still annoying. --- sql/slave.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'sql/slave.cc') diff --git a/sql/slave.cc b/sql/slave.cc index 10ec0050d05..66068bec45a 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -1988,7 +1988,14 @@ static int init_slave_thread(THD* thd, SLAVE_THD_TYPE thd_type) thd->master_access= ~0; thd->priv_user = 0; thd->slave_thread = 1; - thd->options = (((opt_log_slave_updates) ? OPTION_BIN_LOG:0) | OPTION_AUTO_IS_NULL) ; + thd->options = ((opt_log_slave_updates) ? OPTION_BIN_LOG:0) | + OPTION_AUTO_IS_NULL | + /* + It's nonsense to constraint the slave threads with max_join_size; if a + query succeeded on master, we HAVE to execute it. + */ + OPTION_BIG_SELECTS ; + thd->client_capabilities = CLIENT_LOCAL_FILES; thd->real_id=pthread_self(); pthread_mutex_lock(&LOCK_thread_count); @@ -2008,9 +2015,6 @@ static int init_slave_thread(THD* thd, SLAVE_THD_TYPE thd_type) VOID(pthread_sigmask(SIG_UNBLOCK,&set,&thd->block_signals)); #endif - if (thd->variables.max_join_size == HA_POS_ERROR) - thd->options |= OPTION_BIG_SELECTS; - if (thd_type == SLAVE_THD_SQL) thd->proc_info= "Waiting for the next event in slave queue"; else -- cgit v1.2.1 From 972a33aea387f29e663b0cd272d3501eede35bf8 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 25 Aug 2003 14:13:58 +0200 Subject: Clearer states in SHOW PROCESSLIST for replication threads. For example the Binlog_dump thread (on the master) sometimes showed "Slave:". And there were confusing messages where "binlog" was employed instead of "relay log". sql/log.cc: MYSQL_LOG::wait_for_update() is used by the binlog_dump and I/Oslave threads, and it updates thd->proc_info, so we need a bool to not show the same proc_info for 2 different things (previously we showed "Slave: etc" and that's bad for a binlog_dump thread). sql/slave.cc: Clearer thd-proc_info for slave threads. sql/sql_class.h: prototype change sql/sql_repl.cc: clearer thd->proc_info for binlog_dump thread --- sql/slave.cc | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) (limited to 'sql/slave.cc') diff --git a/sql/slave.cc b/sql/slave.cc index 66068bec45a..07c9bb7bd8a 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -1443,7 +1443,8 @@ static bool wait_for_relay_log_space(RELAY_LOG_INFO* rli) pthread_mutex_lock(&rli->log_space_lock); const char* save_proc_info= thd->enter_cond(&rli->log_space_cond, &rli->log_space_lock, - "Waiting for relay log space to free"); + "Waiting for the SQL slave \ +thread to free enough relay log space"); while (rli->log_space_limit < rli->log_space_total && !(slave_killed=io_slave_killed(thd,mi)) && !rli->ignore_log_space_limit) @@ -1925,7 +1926,8 @@ int st_relay_log_info::wait_for_pos(THD* thd, String* log_name, DBUG_PRINT("info",("Waiting for master update")); const char* msg = thd->enter_cond(&data_cond, &data_lock, - "Waiting for master update"); + "Waiting for the SQL slave thread to \ +advance position"); /* We are going to pthread_cond_(timed)wait(); if the SQL thread stops it will wake us up. @@ -2016,7 +2018,7 @@ static int init_slave_thread(THD* thd, SLAVE_THD_TYPE thd_type) #endif if (thd_type == SLAVE_THD_SQL) - thd->proc_info= "Waiting for the next event in slave queue"; + thd->proc_info= "Waiting for the next event in relay log"; else thd->proc_info= "Waiting for master update"; thd->version=refresh_version; @@ -2338,7 +2340,7 @@ slave_begin: } - thd->proc_info = "connecting to master"; + thd->proc_info = "Connecting to master"; // we can get killed during safe_connect if (!safe_connect(thd, mysql, mi)) sql_print_error("Slave I/O thread: connected to master '%s@%s:%d',\ @@ -2385,7 +2387,7 @@ dump"); goto err; } - thd->proc_info = "Waiiting to reconnect after a failed dump request"; + thd->proc_info= "Waiting to reconnect after a failed binlog dump request"; mc_end_server(mysql); /* First time retry immediately, assuming that we can recover @@ -2406,7 +2408,7 @@ dump"); goto err; } - thd->proc_info = "Reconnecting after a failed dump request"; + thd->proc_info = "Reconnecting after a failed binlog dump request"; if (!suppress_warnings) sql_print_error("Slave I/O thread: failed dump request, \ reconnecting to try again, log '%s' at postion %s", IO_RPL_LOG_NAME, @@ -2425,7 +2427,13 @@ after reconnect"); while (!io_slave_killed(thd,mi)) { bool suppress_warnings= 0; - thd->proc_info = "Reading master update"; + /* + We say "waiting" because read_event() will wait if there's nothing to + read. But if there's something to read, it will not wait. The important + thing is to not confuse users by saying "reading" whereas we're in fact + receiving nothing. + */ + thd->proc_info = "Waiting for master to send event"; ulong event_len = read_event(mysql, mi, &suppress_warnings); if (io_slave_killed(thd,mi)) { @@ -2452,7 +2460,8 @@ max_allowed_packet", mc_mysql_error(mysql)); goto err; } - thd->proc_info = "Waiting to reconnect after a failed read"; + thd->proc_info = "Waiting to reconnect after a failed master event \ +read"; mc_end_server(mysql); if (retry_count++) { @@ -2468,7 +2477,7 @@ max_allowed_packet", reconnect after a failed read"); goto err; } - thd->proc_info = "Reconnecting after a failed read"; + thd->proc_info = "Reconnecting after a failed master event read"; if (!suppress_warnings) sql_print_error("Slave I/O thread: Failed reading log event, \ reconnecting to retry, log '%s' position %s", IO_RPL_LOG_NAME, @@ -2485,7 +2494,7 @@ reconnect done to recover from failed read"); } // if (event_len == packet_error) retry_count=0; // ok event, reset retry counter - thd->proc_info = "Queueing event from master"; + thd->proc_info = "Queueing master event to the relay log"; if (queue_event(mi,(const char*)mysql->net.read_pos + 1, event_len)) { @@ -2667,7 +2676,7 @@ log '%s' at position %s, relay log '%s' position: %s", RPL_LOG_NAME, while (!sql_slave_killed(thd,rli)) { - thd->proc_info = "Processing master log event"; + thd->proc_info = "Reading event from the relay log"; DBUG_ASSERT(rli->sql_thd == thd); THD_CHECK_SENTRY(thd); if (exec_relay_log_event(thd,rli)) @@ -3396,7 +3405,7 @@ rli->relay_log_pos=%s rli->pending=%lu", pthread_mutex_unlock(&rli->log_space_lock); pthread_cond_broadcast(&rli->log_space_cond); // Note that wait_for_update unlocks lock_log ! - rli->relay_log.wait_for_update(rli->sql_thd); + rli->relay_log.wait_for_update(rli->sql_thd, 1); // re-acquire data lock since we released it earlier pthread_mutex_lock(&rli->data_lock); continue; -- cgit v1.2.1 From 2dc7a5ba8e6df779807235fec28cc184b0327d66 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 25 Aug 2003 16:20:21 +0200 Subject: comments about mutexes in replication. Don't start the SQL slave thread with SQL_BIG_SELECTS; it's better to inhibate max_join_size instead. sql/slave.cc: OPTION_BIG_SELECTS does more than ignoring max_join_size (talks to the optimiser), just ignore max_join_size. sql/slave.h: comments --- sql/slave.cc | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'sql/slave.cc') diff --git a/sql/slave.cc b/sql/slave.cc index 07c9bb7bd8a..1bc8dfc5b78 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -1991,13 +1991,12 @@ static int init_slave_thread(THD* thd, SLAVE_THD_TYPE thd_type) thd->priv_user = 0; thd->slave_thread = 1; thd->options = ((opt_log_slave_updates) ? OPTION_BIN_LOG:0) | - OPTION_AUTO_IS_NULL | - /* - It's nonsense to constraint the slave threads with max_join_size; if a - query succeeded on master, we HAVE to execute it. - */ - OPTION_BIG_SELECTS ; - + OPTION_AUTO_IS_NULL; + /* + It's nonsense to constraint the slave threads with max_join_size; if a + query succeeded on master, we HAVE to execute it. + */ + thd->variables.max_join_size= HA_POS_ERROR; thd->client_capabilities = CLIENT_LOCAL_FILES; thd->real_id=pthread_self(); pthread_mutex_lock(&LOCK_thread_count); -- cgit v1.2.1