Commit 7480ef38 authored by guilhem@mysql.com's avatar guilhem@mysql.com

disabling the --innodb-safe-binlog option. It should be fixed to work with MyISAM too,

before being available to users. That will be the case in 4.1.4.
The "bk commit in mysqldoc" corresponding to this feature was not pushed.
Removing the 6 tests, they'll be pushed again later.
parent 62e0e3bd
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;
flush logs;
set autocommit=1;
set sql_log_bin=0;
create table t1 (n int) engine=innodb;
set sql_log_bin=1;
create table t1 (n int) engine=myisam;
insert into t1 values (3);
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000002 64
insert into t1 values (4);
select * from t1;
n
3
set @a=load_file("MYSQL_TEST_DIR/var/log/master-bin.000002");
select length(@a);
length(@a)
124
select @a like "%values (4)%";
@a like "%values (4)%"
1
select * from t1;
n
3
insert into t1 values (5);
select * from t1;
n
3
5
select * from t1;
n
3
start slave;
select * from t1;
n
3
5
set @a=load_file("MYSQL_TEST_DIR/var/log/master-bin.000002");
select length(@a);
length(@a)
64
select @a like "%values (4)%";
@a like "%values (4)%"
0
drop table if exists t1;
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;
flush logs;
set autocommit=0;
set sql_log_bin=0;
create table t1(n int) engine=innodb;
set sql_log_bin=1;
create table t1(n int) engine=myisam;
insert into t1 values (3);
insert into t1 values (4);
commit;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000002 205
insert into t1 values (5);
insert into t1 values (6);
commit;
select * from t1;
n
3
4
set @a=load_file("MYSQL_TEST_DIR/var/log/master-bin.000002");
select length(@a);
length(@a)
406
select @a like "%values (5)%";
@a like "%values (5)%"
1
select * from t1;
n
3
4
insert into t1 values (7);
select * from t1;
n
3
4
7
select * from t1;
n
3
4
start slave;
select * from t1;
n
3
4
7
set @a=load_file("MYSQL_TEST_DIR/var/log/master-bin.000002");
select length(@a);
length(@a)
205
select @a like "%values (5)%";
@a like "%values (5)%"
0
drop table if exists t1;
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;
flush logs;
set autocommit=1;
set sql_log_bin=0;
create table t1 (n int) engine=innodb;
set sql_log_bin=1;
create table t1 (n int) engine=myisam;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000002 4
insert into t1 values (4);
select * from t1;
n
set @a=load_file("MYSQL_TEST_DIR/var/log/master-bin.000002");
select length(@a);
length(@a)
64
select @a like "%values (4)%";
@a like "%values (4)%"
1
select * from t1;
n
insert into t1 values (5);
select * from t1;
n
5
select * from t1;
n
start slave;
select * from t1;
n
5
set @a=load_file("MYSQL_TEST_DIR/var/log/master-bin.000002");
select length(@a);
length(@a)
4
select @a like "%values (4)%";
@a like "%values (4)%"
0
drop table if exists t1;
--innodb-safe-binlog --crash-binlog-innodb=3
# Test if master cuts binlog at InnoDB crash's recovery,
# if the transaction had been written to binlog but not committed into InnoDB
# We need InnoDB in the master, and a debug build in the master.
# There are 6 tests, in fact 3 pairs:
# 1st pair:
# rpl_crash_binlog_innodb_1a: crash when InnoDB in autocommit mode
# rpl_crash_binlog_innodb_1b: test of recovery after the crash of test 1a
# 2nd pair:
# rpl_crash_binlog_innodb_2a: crash when InnoDB in non autocommit mode
# rpl_crash_binlog_innodb_2b: test of recovery after the crash of test 1a
# 3rd pair:
# rpl_crash_binlog_innodb_3a: crash when InnoDB in autocommit mode, at
# very first transactional statement since master's startup (a purely
# academic case but which will be tested a lot)
# rpl_crash_binlog_innodb_3b: test of recovery after the crash of test 3a
# The *b tests should always be run just after their 1a; don't run *b
# alone it won't work properly.
# This test is only for autocommit mode.
source include/master-slave.inc ;
source include/have_debug.inc ;
source include/have_innodb.inc ;
require_os unix ;
flush logs; # this will help us be sure it's the same log in the next test
# One problem: we need InnoDB to know of the last good position, so it
# must have committed at least one transaction and in the binlog before the crash.
# NOTE: the above should become false quite soon
set autocommit=1;
set sql_log_bin=0;
create table t1 (n int) engine=innodb;
set sql_log_bin=1;
sync_slave_with_master;
# We use MyISAM on slave so that any spurious statement received from the
# master has a visible effect.
create table t1 (n int) engine=myisam;
connection master;
insert into t1 values (3);
# The reported size here should be exactly the same as the one we measure
# at the end of rpl_crash_binlog_innodb_1b.test
show master status;
# Master will crash in this (it crashes on 3rd binlog write, counting
# the DROP IF EXISTS in master-slave.inc):
error 2013;
send insert into t1 values (4);
sleep 4; # enough time to die
# No 'reap' as it may hang as master died hard.
# This kill speeds up:
system sh misc/kill_master.sh ;
# Check that slave did not receive the spurious INSERT statement
connection slave;
select * from t1;
# Check that the spurious statement is in the master's binlog
# LOAD_FILE() needs a file readable by all
system chmod ugo+r $MYSQL_TEST_DIR/var/log/master-bin.000002 ;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval set @a=load_file("$MYSQL_TEST_DIR/var/log/master-bin.000002");
select length(@a);
select @a like "%values (4)%";
# Now we will run rpl_crash_binlog_innodb_1b.test to test
# if the spurious statement gets truncated at master's restart.
# Test if master cuts binlog at InnoDB crash's recovery,
# after we crashed intentionally in rpl_crash_binlog_innodb_1a.test
# (1a and 1b are two tests, 1b should NOT be run if 1a has not be run
# just before). So don't run 1b alone.
# We need InnoDB in the master, and a debug build in the master.
# We don't use master-slave.inc because it would RESET MASTER.
connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,);
connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT,);
source include/have_debug.inc
source include/have_innodb.inc
require_os unix ;
connection master;
# check that transaction was rolled back on master
select * from t1;
insert into t1 values (5);
select * from t1;
save_master_pos;
# Check that slave did not receive the spurious INSERT statement
connection slave;
select * from t1;
start slave;
sync_with_master;
select * from t1;
# Check that the spurious statement is NOT in the master's binlog anymore
# LOAD_FILE() needs a file readable by all
system chmod ugo+r $MYSQL_TEST_DIR/var/log/master-bin.000002 ;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval set @a=load_file("$MYSQL_TEST_DIR/var/log/master-bin.000002");
select length(@a);
select @a like "%values (4)%";
connection master;
drop table if exists t1;
sync_slave_with_master;
--innodb-safe-binlog --crash-binlog-innodb=3
# Test if master cuts binlog at InnoDB crash's recovery,
# if the transaction had been written to binlog but not committed into InnoDB
# We need InnoDB in the master, and a debug build in the master.
# This test is only for NON autocommit mode.
# More comments in rpl_crash_binlog_ib_1a.test
source include/master-slave.inc;
source include/have_debug.inc
source include/have_innodb.inc
require_os unix ;
flush logs;
set autocommit=0;
set sql_log_bin=0;
create table t1(n int) engine=innodb;
set sql_log_bin=1;
sync_slave_with_master;
create table t1(n int) engine=myisam;
connection master;
insert into t1 values (3);
insert into t1 values (4);
commit;
show master status;
insert into t1 values (5);
insert into t1 values (6);
error 2013;
send commit;
sleep 4;
system sh misc/kill_master.sh ;
connection slave;
select * from t1;
system chmod ugo+r $MYSQL_TEST_DIR/var/log/master-bin.000002 ;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval set @a=load_file("$MYSQL_TEST_DIR/var/log/master-bin.000002");
select length(@a);
select @a like "%values (5)%";
# Now we will run rpl_crash_binlog_ib_2b.test to test
# if the spurious transaction gets truncated at master's restart.
# Test if master cuts binlog at InnoDB crash's recovery,
# after we crashed intentionally in rpl_crash_binlog_innodb_2a.test
# We need InnoDB in the master, and a debug build in the master.
# We don't use master-slave.inc because it would RESET MASTER.
connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,);
connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT,);
source include/have_debug.inc
source include/have_innodb.inc
require_os unix ;
connection master;
select * from t1;
insert into t1 values (7);
select * from t1;
save_master_pos;
connection slave;
select * from t1;
start slave;
sync_with_master;
select * from t1;
system chmod ugo+r $MYSQL_TEST_DIR/var/log/master-bin.000002 ;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval set @a=load_file("$MYSQL_TEST_DIR/var/log/master-bin.000002");
select length(@a);
select @a like "%values (5)%";
connection master;
drop table if exists t1;
sync_slave_with_master;
--innodb-safe-binlog --crash-binlog-innodb=2
# Test if master cuts binlog at InnoDB crash's recovery,
# if the transaction had been written to binlog but not committed into InnoDB
# We need InnoDB in the master, and a debug build in the master.
# This test is only for autocommit mode, with a crash at very first
# transactional statement since startup.
# More comments in rpl_crash_binlog_ib_1a.test
source include/master-slave.inc ;
source include/have_debug.inc ;
source include/have_innodb.inc ;
require_os unix ;
flush logs;
set autocommit=1;
set sql_log_bin=0;
create table t1 (n int) engine=innodb;
set sql_log_bin=1;
sync_slave_with_master;
create table t1 (n int) engine=myisam;
connection master;
show master status;
error 2013;
send insert into t1 values (4);
sleep 4; # enough time to die
system sh misc/kill_master.sh ;
connection slave;
select * from t1;
system chmod ugo+r $MYSQL_TEST_DIR/var/log/master-bin.000002 ;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval set @a=load_file("$MYSQL_TEST_DIR/var/log/master-bin.000002");
select length(@a);
select @a like "%values (4)%";
# Now we will run rpl_crash_binlog_innodb_3b.test to test
# if the spurious statement gets truncated at master's restart.
# Test if master cuts binlog at InnoDB crash's recovery,
# after we crashed intentionally in rpl_crash_binlog_innodb_3a.test
# We need InnoDB in the master, and a debug build in the master.
# We don't use master-slave.inc because it would RESET MASTER.
connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,);
connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT,);
source include/have_debug.inc
source include/have_innodb.inc
require_os unix ;
connection master;
select * from t1;
insert into t1 values (5);
select * from t1;
save_master_pos;
connection slave;
select * from t1;
start slave;
sync_with_master;
select * from t1;
system chmod ugo+r $MYSQL_TEST_DIR/var/log/master-bin.000002 ;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval set @a=load_file("$MYSQL_TEST_DIR/var/log/master-bin.000002");
select length(@a);
select @a like "%values (4)%";
connection master;
drop table if exists t1;
sync_slave_with_master;
......@@ -269,7 +269,7 @@ my_bool opt_secure_auth= 0;
my_bool opt_short_log_format= 0;
my_bool opt_log_queries_not_using_indexes= 0;
my_bool lower_case_file_system= 0;
my_bool opt_innodb_safe_binlog;
my_bool opt_innodb_safe_binlog= 0;
volatile bool mqh_used = 0;
uint mysqld_port, test_flags, select_errors, dropping_tables, ha_open_options;
......@@ -4628,6 +4628,12 @@ replicating a LOAD DATA INFILE command.",
(gptr*) &innobase_lock_wait_timeout, (gptr*) &innobase_lock_wait_timeout,
0, GET_LONG, REQUIRED_ARG, 50, 1, 1024 * 1024 * 1024, 0, 1, 0},
#ifdef HAVE_REPLICATION
/*
Disabled for the 4.1.3 release. Disabling just this paragraph of code is
enough, as then user can't set it to 1 so it will always be ignored in the
rest of code.
*/
#if MYSQL_VERSION_ID > 40103
/*
innodb_safe_binlog is not a variable, just an option. Does not make
sense to make it a variable, as it is only used at startup (and so the
......@@ -4640,6 +4646,7 @@ InnoDB committed transaction. Use only if this server updates ONLY InnoDB \
tables.",
(gptr*) &opt_innodb_safe_binlog, (gptr*) &opt_innodb_safe_binlog,
0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 1, 0},
#endif
#endif
{"innodb_thread_concurrency", OPT_INNODB_THREAD_CONCURRENCY,
"Helps in performance tuning in heavily concurrent environments.",
......
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