Below is the list of changes that have just been committed into a local
5.0 repository of bar. When bar 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.2396 07/02/21 18:32:19 bar@stripped +3 -0
Bug#22725 Replication outages from ER_SERVER_SHUTDOWN (1053) set in replication events
Problem: Killing an update on a transactional table on master made slave die with error.
Fix: don't log error immediately into the statement header. The entire
transaction will be correctly rolled back.
Many thank to Guilhem, Andrei, Mats for help with this bug.
mysql-test/t/rpl_tnx_shutdown.test
1.1 07/02/21 18:32:17 bar@stripped +40 -0
Adding test case
mysql-test/t/rpl_tnx_shutdown.test
1.0 07/02/21 18:32:17 bar@stripped +0 -0
BitKeeper file /home/bar/mysql-5.0.b22725/mysql-test/t/rpl_tnx_shutdown.test
mysql-test/r/rpl_tnx_shutdown.result
1.1 07/02/21 18:32:16 bar@stripped +23 -0
Adding test case
sql/log_event.cc
1.225 07/02/21 18:32:16 bar@stripped +3 -2
When updating a transactional table,
don't record the "killed" information inside the event
because we don't want the slave to stop with error.
Execution should reach end of transaction, then
the entire transaction should be rolled back.
mysql-test/r/rpl_tnx_shutdown.result
1.0 07/02/21 18:32:16 bar@stripped +0 -0
BitKeeper file /home/bar/mysql-5.0.b22725/mysql-test/r/rpl_tnx_shutdown.result
# 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: bar
# Host: bar.myoffice.izhnet.ru
# Root: /home/bar/mysql-5.0.b22725
--- 1.224/sql/log_event.cc 2007-02-08 18:53:11 +04:00
+++ 1.225/sql/log_event.cc 2007-02-21 18:32:16 +04:00
@@ -1262,9 +1262,10 @@
using_trans),
data_buf(0), query(query_arg), catalog(thd_arg->catalog),
db(thd_arg->db), q_len((uint32) query_length),
- error_code((thd_arg->killed != THD::NOT_KILLED) ?
+ error_code(thd->no_trans_update ?
+ (thd_arg->killed != THD::NOT_KILLED) ?
((thd_arg->system_thread & SYSTEM_THREAD_DELAYED_INSERT) ?
- 0 : thd->killed_errno()) : thd_arg->net.last_errno),
+ 0 : thd->killed_errno()) : thd_arg->net.last_errno : 0),
thread_id(thd_arg->thread_id),
/* save the original thread id; we already know the server id */
slave_proxy_id(thd_arg->variables.pseudo_thread_id),
--- New file ---
+++ mysql-test/r/rpl_tnx_shutdown.result 07/02/21 18:32:16
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
create table t1 (a int) engine=heap;
create table t2 (a int) engine=innodb;
insert into t1 select connection_id();
begin;
insert into t2 select sleep(10);
select @kill_id:=a from t1;
@kill_id:=a
#
drop table t1;
kill connection @kill_id;
commit;
commit;
select * from t2;
a
select * from t2;
a
drop table t2;
--- New file ---
+++ mysql-test/t/rpl_tnx_shutdown.test 07/02/21 18:32:17
--source include/have_innodb.inc
--source include/master-slave.inc
--source include/not_embedded.inc
--source include/not_windows.inc
connection master;
create table t1 (a int) engine=heap;
create table t2 (a int) engine=innodb;
connect (con1,localhost,root,,);
connection con1;
insert into t1 select connection_id();
# Now start a transaction which will be killed
begin;
send insert into t2 select sleep(10);
connection master;
--replace_column 1 #
select @kill_id:=a from t1;
drop table t1;
kill connection @kill_id;
commit;
connection con1;
# See flush_read_lock_kill.test why these codes
--error 0,1053,2013
reap;
# Make sure that killed transaction didn't insert any records on master
connection master;
commit;
select * from t2;
# Make sure that killed transaction didn't insert any records on slave
sync_slave_with_master;
connection slave;
select * from t2;
# Clean-up
connection master;
drop table t2;
sync_slave_with_master;
| Thread |
|---|
| • bk commit into 5.0 tree (bar:1.2396) BUG#22725 | bar | 21 Feb |