1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
|
include/master-slave.inc
Warnings:
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
Note #### Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information.
[connection master]
include/stop_slave.inc
set @save.replica_parallel_workers= @@global.replica_parallel_workers;
set @@global.replica_parallel_workers= 4;
include/start_slave.inc
create database d1;
create database d2;
create database d3;
create table d1.t1 (a int auto_increment primary key) engine=innodb;
create table d2.t1 (a int auto_increment primary key) engine=innodb;
create table d3.t1 (a int auto_increment primary key) engine=innodb;
include/sync_slave_sql_with_master.inc
begin;
insert into d2.t1 values (1);
begin;
use d1;
insert into d1.t1 values (null);
use d2;
insert into d2.t1 values (1);
commit;
begin;
use d3;
insert into d3.t1 values (null);
use d1;
insert into d1.t1 values (null);
commit;
Either the coordinator is waiting for a worker to unlock d1
(binlog transaction compression OFF) or the coordinator
has scheduled the 2nd transaction to the sane worker (binlog
transaction compression ON)
rollback;
include/sync_slave_sql_with_master.inc
select count(*) from d1.t1 into @d1;
select count(*) from d2.t1 into @d2;
select count(*) from d3.t1 into @d3;
use d1;
create table `exists_only_on_slave` (a int);
begin;
insert into d1.t1 values (null);
insert into d2.t1 values (null);
insert into d3.t1 values (null);
begin;
use d1;
insert into d1.t1 values (null);
commit;
begin;
use d2;
insert into d2.t1 values (null);
commit;
begin;
use d3;
insert into d3.t1 values (null);
commit;
use d1;
drop table if exists `exists_only_on_slave`;
select sleep(1);
sleep(1)
0
select count(*) - @d1 as 'zero' from d1.t1;
zero
0
select count(*) - @d2 as 'zero' from d2.t1;
zero
0
select count(*) - @d3 as 'zero' from d3.t1;
zero
0
use d1;
select count(*) as 'zero' from `exists_only_on_slave`;
zero
0
rollback;
drop database d1;
drop database d2;
drop database d3;
include/sync_slave_sql_with_master.inc
set @@global.replica_parallel_workers= @save.replica_parallel_workers;
include/rpl_end.inc
|