2005-03-02 11:29:48 +01:00
|
|
|
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 not null, key(a)) engine=innodb;
|
|
|
|
create table t2 (a int not null, key(a)) engine=innodb;
|
2006-10-11 09:16:37 +02:00
|
|
|
create table t3 (a int unique) engine=innodb;
|
2005-03-02 11:29:48 +01:00
|
|
|
create table t4 (a int) engine=innodb;
|
2005-03-23 19:19:36 +01:00
|
|
|
show variables like 'slave_transaction_retries';
|
|
|
|
Variable_name Value
|
2005-03-24 16:11:58 +01:00
|
|
|
slave_transaction_retries 10
|
2005-03-02 11:29:48 +01:00
|
|
|
show create table t1;
|
|
|
|
Table Create Table
|
|
|
|
t1 CREATE TABLE `t1` (
|
2005-03-02 17:52:38 +01:00
|
|
|
`a` int(11) NOT NULL,
|
2005-03-02 11:29:48 +01:00
|
|
|
KEY `a` (`a`)
|
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
|
|
|
show create table t2;
|
|
|
|
Table Create Table
|
|
|
|
t2 CREATE TABLE `t2` (
|
2005-03-02 17:52:38 +01:00
|
|
|
`a` int(11) NOT NULL,
|
2005-03-02 11:29:48 +01:00
|
|
|
KEY `a` (`a`)
|
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
2005-03-23 19:19:36 +01:00
|
|
|
show variables like 'slave_transaction_retries';
|
|
|
|
Variable_name Value
|
|
|
|
slave_transaction_retries 2
|
2005-03-02 11:29:48 +01:00
|
|
|
stop slave;
|
|
|
|
begin;
|
|
|
|
insert into t3 select * from t2 for update;
|
|
|
|
insert into t1 values(1);
|
|
|
|
commit;
|
|
|
|
begin;
|
|
|
|
select * from t1 for update;
|
|
|
|
a
|
|
|
|
start slave;
|
2006-10-11 09:16:37 +02:00
|
|
|
insert into t2 values(201);
|
2005-03-02 11:29:48 +01:00
|
|
|
commit;
|
|
|
|
select * from t1;
|
|
|
|
a
|
|
|
|
1
|
|
|
|
select * from t2;
|
|
|
|
a
|
2006-10-11 09:16:37 +02:00
|
|
|
201
|
2005-03-02 11:29:48 +01:00
|
|
|
show slave status;
|
2006-04-13 20:42:48 +02:00
|
|
|
Slave_IO_State #
|
|
|
|
Master_Host 127.0.0.1
|
|
|
|
Master_User root
|
|
|
|
Master_Port MASTER_MYPORT
|
|
|
|
Connect_Retry 1
|
|
|
|
Master_Log_File master-bin.000001
|
2006-10-11 09:16:37 +02:00
|
|
|
Read_Master_Log_Pos 18918
|
2006-04-13 20:42:48 +02:00
|
|
|
Relay_Log_File #
|
|
|
|
Relay_Log_Pos #
|
|
|
|
Relay_Master_Log_File master-bin.000001
|
|
|
|
Slave_IO_Running Yes
|
|
|
|
Slave_SQL_Running Yes
|
|
|
|
Replicate_Do_DB
|
|
|
|
Replicate_Ignore_DB
|
|
|
|
Replicate_Do_Table
|
|
|
|
Replicate_Ignore_Table
|
|
|
|
Replicate_Wild_Do_Table
|
|
|
|
Replicate_Wild_Ignore_Table
|
|
|
|
Last_Errno 0
|
|
|
|
Last_Error
|
|
|
|
Skip_Counter 0
|
2006-10-11 09:16:37 +02:00
|
|
|
Exec_Master_Log_Pos 18918
|
2006-04-13 20:42:48 +02:00
|
|
|
Relay_Log_Space #
|
|
|
|
Until_Condition None
|
|
|
|
Until_Log_File
|
|
|
|
Until_Log_Pos 0
|
|
|
|
Master_SSL_Allowed No
|
|
|
|
Master_SSL_CA_File
|
|
|
|
Master_SSL_CA_Path
|
|
|
|
Master_SSL_Cert
|
|
|
|
Master_SSL_Cipher
|
|
|
|
Master_SSL_Key
|
|
|
|
Seconds_Behind_Master #
|
2005-03-02 11:29:48 +01:00
|
|
|
stop slave;
|
2006-10-11 09:16:37 +02:00
|
|
|
delete from t3;
|
|
|
|
change master to master_log_pos=539;
|
2005-03-02 11:29:48 +01:00
|
|
|
begin;
|
|
|
|
select * from t2 for update;
|
|
|
|
a
|
2006-10-11 09:16:37 +02:00
|
|
|
201
|
2005-03-02 11:29:48 +01:00
|
|
|
start slave;
|
2006-10-11 09:16:37 +02:00
|
|
|
select count(*) from t3 /* must be zero */;
|
|
|
|
count(*)
|
|
|
|
0
|
2005-03-02 11:29:48 +01:00
|
|
|
commit;
|
|
|
|
select * from t1;
|
|
|
|
a
|
|
|
|
1
|
|
|
|
1
|
|
|
|
select * from t2;
|
|
|
|
a
|
2006-10-11 09:16:37 +02:00
|
|
|
201
|
2005-03-02 11:29:48 +01:00
|
|
|
show slave status;
|
2006-04-13 20:42:48 +02:00
|
|
|
Slave_IO_State #
|
|
|
|
Master_Host 127.0.0.1
|
|
|
|
Master_User root
|
|
|
|
Master_Port MASTER_MYPORT
|
|
|
|
Connect_Retry 1
|
|
|
|
Master_Log_File master-bin.000001
|
2006-10-11 09:16:37 +02:00
|
|
|
Read_Master_Log_Pos 18918
|
2006-04-13 20:42:48 +02:00
|
|
|
Relay_Log_File #
|
|
|
|
Relay_Log_Pos #
|
|
|
|
Relay_Master_Log_File master-bin.000001
|
|
|
|
Slave_IO_Running #
|
|
|
|
Slave_SQL_Running Yes
|
|
|
|
Replicate_Do_DB
|
|
|
|
Replicate_Ignore_DB
|
|
|
|
Replicate_Do_Table
|
|
|
|
Replicate_Ignore_Table
|
|
|
|
Replicate_Wild_Do_Table
|
|
|
|
Replicate_Wild_Ignore_Table
|
|
|
|
Last_Errno 0
|
|
|
|
Last_Error
|
|
|
|
Skip_Counter 0
|
2006-10-11 09:16:37 +02:00
|
|
|
Exec_Master_Log_Pos 18918
|
2006-04-13 20:42:48 +02:00
|
|
|
Relay_Log_Space #
|
|
|
|
Until_Condition None
|
|
|
|
Until_Log_File
|
|
|
|
Until_Log_Pos 0
|
|
|
|
Master_SSL_Allowed No
|
|
|
|
Master_SSL_CA_File
|
|
|
|
Master_SSL_CA_Path
|
|
|
|
Master_SSL_Cert
|
|
|
|
Master_SSL_Cipher
|
|
|
|
Master_SSL_Key
|
|
|
|
Seconds_Behind_Master #
|
2006-11-15 10:23:27 +01:00
|
|
|
set @my_max_relay_log_size= @@global.max_relay_log_size;
|
2005-03-02 11:29:48 +01:00
|
|
|
set global max_relay_log_size=0;
|
|
|
|
stop slave;
|
2006-10-11 09:16:37 +02:00
|
|
|
delete from t3;
|
|
|
|
change master to master_log_pos=539;
|
2005-03-02 11:29:48 +01:00
|
|
|
begin;
|
|
|
|
select * from t2 for update;
|
|
|
|
a
|
2006-10-11 09:16:37 +02:00
|
|
|
201
|
2005-03-02 11:29:48 +01:00
|
|
|
start slave;
|
2006-10-11 09:16:37 +02:00
|
|
|
select count(*) from t3 /* must be zero */;
|
|
|
|
count(*)
|
|
|
|
0
|
2005-03-02 11:29:48 +01:00
|
|
|
commit;
|
|
|
|
select * from t1;
|
|
|
|
a
|
|
|
|
1
|
|
|
|
1
|
|
|
|
1
|
|
|
|
select * from t2;
|
|
|
|
a
|
2006-10-11 09:16:37 +02:00
|
|
|
201
|
2005-03-02 11:29:48 +01:00
|
|
|
show slave status;
|
2006-04-13 20:42:48 +02:00
|
|
|
Slave_IO_State #
|
|
|
|
Master_Host 127.0.0.1
|
|
|
|
Master_User root
|
|
|
|
Master_Port MASTER_MYPORT
|
|
|
|
Connect_Retry 1
|
|
|
|
Master_Log_File master-bin.000001
|
2006-10-11 09:16:37 +02:00
|
|
|
Read_Master_Log_Pos 18918
|
2006-04-13 20:42:48 +02:00
|
|
|
Relay_Log_File #
|
|
|
|
Relay_Log_Pos #
|
|
|
|
Relay_Master_Log_File master-bin.000001
|
|
|
|
Slave_IO_Running #
|
|
|
|
Slave_SQL_Running Yes
|
|
|
|
Replicate_Do_DB
|
|
|
|
Replicate_Ignore_DB
|
|
|
|
Replicate_Do_Table
|
|
|
|
Replicate_Ignore_Table
|
|
|
|
Replicate_Wild_Do_Table
|
|
|
|
Replicate_Wild_Ignore_Table
|
|
|
|
Last_Errno 0
|
|
|
|
Last_Error
|
|
|
|
Skip_Counter 0
|
2006-10-11 09:16:37 +02:00
|
|
|
Exec_Master_Log_Pos 18918
|
2006-04-13 20:42:48 +02:00
|
|
|
Relay_Log_Space #
|
|
|
|
Until_Condition None
|
|
|
|
Until_Log_File
|
|
|
|
Until_Log_Pos 0
|
|
|
|
Master_SSL_Allowed No
|
|
|
|
Master_SSL_CA_File
|
|
|
|
Master_SSL_CA_Path
|
|
|
|
Master_SSL_Cert
|
|
|
|
Master_SSL_Cipher
|
|
|
|
Master_SSL_Key
|
|
|
|
Seconds_Behind_Master #
|
2005-07-13 13:49:35 +02:00
|
|
|
drop table t1,t2,t3,t4;
|
2006-11-15 10:23:27 +01:00
|
|
|
set global max_relay_log_size= @my_max_relay_log_size;
|