Below is the list of changes that have just been committed into a local
5.0 repository of elkin. When elkin 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.2137 06/04/05 15:30:08 aelkin@stripped +4 -0
Bug#17284 erroneous temp table cleanup on slave.
Idea of the fix is for master to send FD event with `created' as 0
to reconnecting slave (upon slave_net_timeout, no master crash) to avoid destroying
temp tables.
In a case of a connect by slave to the master after its crash temp tables have been
already
cleaned up so that slave can not keep `orphan' temp tables.
mysql-test/include/get_binlog_dump_thread_id.inc
1.1 06/04/05 15:29:59 aelkin@stripped +5 -0
mysqltest's preudo-macro to calculate $id master dump thread id
sql/sql_repl.cc
1.148 06/04/05 15:29:59 aelkin@stripped +6 -0
Storing zero for assigning to `created' of FD event on the reconnecting slave.
mysql-test/t/rpl_temporary.test
1.16 06/04/05 15:29:59 aelkin@stripped +25 -1
wait-free addon to check temp tables are ok after slave reconnect.
mysql-test/r/rpl_temporary.result
1.19 06/04/05 15:29:59 aelkin@stripped +12 -0
results
mysql-test/include/get_binlog_dump_thread_id.inc
1.0 06/04/05 15:29:59 aelkin@stripped +0 -0
BitKeeper file
/usr_rh9/home/elkin.rh9/MySQL/FIXES/5.0.21-bug17284-temp_table/mysql-test/include/get_binlog_dump_thread_id.inc
# 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: aelkin
# Host: dsl-hkigw8-feb0de00-199.dhcp.inet.fi
# Root: /usr_rh9/home/elkin.rh9/MySQL/FIXES/5.0.21-bug17284-temp_table
--- New file ---
+++ mysql-test/include/get_binlog_dump_thread_id.inc 06/04/05 15:29:59
--exec $MYSQL test -e 'show processlist' | grep 'Binlog Dump' | cut -f1 >
$MYSQLTEST_VARDIR/tmp/bl_dump_thread_id
--replace_result $MYSQL_TEST_DIR "."
eval LOAD DATA INFILE "$MYSQLTEST_VARDIR/tmp/bl_dump_thread_id" into table t4;
let $id = `select f from t4`;
delete from t4;
--- 1.147/sql/sql_repl.cc 2006-01-03 18:54:37 +02:00
+++ 1.148/sql/sql_repl.cc 2006-04-05 15:29:59 +03:00
@@ -466,6 +466,12 @@
(rli->group_master_log_pos)
*/
int4store((char*) packet->ptr()+LOG_POS_OFFSET+1, 0);
+ /*
+ if reconnect master sends FD event with `created' as 0
+ to avoid destroying temp tables.
+ */
+ int4store((char*) packet->ptr()+LOG_EVENT_MINIMAL_HEADER_LEN+
+ ST_CREATED_OFFSET+1, (ulong) 0);
/* send it */
if (my_net_write(net, (char*)packet->ptr(), packet->length()))
{
--- 1.18/mysql-test/r/rpl_temporary.result 2005-03-23 20:18:16 +02:00
+++ 1.19/mysql-test/r/rpl_temporary.result 2006-04-05 15:29:59 +03:00
@@ -89,3 +89,15 @@
7
drop table t1,t2;
create temporary table t3 (f int);
+create temporary table t4 (f int);
+create table t5 (f int);
+LOAD DATA INFILE "./var/tmp/bl_dump_thread_id" into table t4;
+delete from t4;
+insert into t4 values (1);
+kill 4;
+insert into t5 select * from t4;
+select * from t5 /* must be 1 after reconnection */;
+f
+1
+drop temporary table t4;
+drop table t5;
--- 1.15/mysql-test/t/rpl_temporary.test 2005-07-28 16:12:37 +03:00
+++ 1.16/mysql-test/t/rpl_temporary.test 2006-04-05 15:29:59 +03:00
@@ -129,6 +129,30 @@
create temporary table t3 (f int);
sync_with_master;
+#
+# Bug#17284 erroneous temp table cleanup on slave
+#
+
+connection master;
+create temporary table t4 (f int);
+create table t5 (f int);
+sync_with_master;
+# find dumper's $id
+source include/get_binlog_dump_thread_id.inc; #requires t4!
+insert into t4 values (1);
+# to stimulate reconnection by slave w/o timeout
+eval kill $id;
+insert into t5 select * from t4;
+save_master_pos;
+
+connection slave;
+sync_with_master;
+select * from t5 /* must be 1 after reconnection */;
+
+connection master;
+drop temporary table t4;
+drop table t5;
+
# The server will now close done
-# End of 4.1 tests
+# End of 5.0 tests
| Thread |
|---|
| • bk commit into 5.0 tree (aelkin:1.2137) BUG#17284 | Andrei Elkin | 5 Apr |