Browse Source
BUG#36197: flush tables (or little table cache) can cause crash on slave
BUG#36197: flush tables (or little table cache) can cause crash on slave
When flushing tables, there were a slight chance that the flush was occuring between processing of two table map events. Since the tables are opened one by one, it might result in that the tables were not valid and that sub- sequent locking of tables would cause the slave to crash. The problem is solved by opening and locking all tables at once using simple_open_n_lock_tables(). Also, the patch contain a change to open_tables() so that pre-locking only takes place when the trg_event_map is not zero, which was not the case before (this caused the lock to be placed in thd->locked_tables instead of thd->lock since the assumption was that triggers would be called later and therefore the tables should be pre-locked).pull/73/head
8 changed files with 112 additions and 211 deletions
-
31mysql-test/include/wait_for_slave_sql_to_start.inc
-
2mysql-test/suite/rpl/r/rpl_found_rows.result
-
4mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result
-
2mysql-test/suite/rpl/t/rpl_found_rows.test
-
5mysql-test/suite/rpl/t/rpl_slave_status.test
-
173sql/log_event.cc
-
99sql/log_event_old.cc
-
7sql/sql_base.cc
@ -0,0 +1,31 @@ |
|||
################################################### |
|||
#Author: Mats (based on file written by Jeb) |
|||
#Date: 2008-05-06 |
|||
#Purpose: To wait for slave SQL thread to start |
|||
#Details: |
|||
# 1) Fill in and setup variables |
|||
# 2) loop through looking for both |
|||
# io and sql threads to start |
|||
# 3) If loops too long die. |
|||
#################################################### |
|||
connection slave; |
|||
let $row_number= 1; |
|||
let $run= 1; |
|||
let $counter= 300; |
|||
|
|||
while ($run) |
|||
{ |
|||
let $sql_result= query_get_value("SHOW SLAVE STATUS", Slave_SQL_Running, $row_number); |
|||
if (`SELECT '$sql_result' = 'Yes'`){ |
|||
let $run= 0; |
|||
} |
|||
sleep 0.1; |
|||
if (!$counter){ |
|||
--echo "Failed while waiting for slave SQL to start" |
|||
query_vertical SHOW SLAVE STATUS; |
|||
exit; |
|||
} |
|||
dec $counter; |
|||
} |
|||
|
|||
|
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue