mirror of
https://github.com/MariaDB/server.git
synced 2025-02-01 11:31:51 +01:00
da61107fc8
Problem:- In the case of multisource replication/named slave when we run "FLUSH LOGS" , it does not flush logs. Solution:- A new function Master_info_index->flush_all_relay_logs() is created which will rotate relay logs for all named slave. This will be called in reload_acl_and_cache function when connection_name.length == 0
78 lines
1.9 KiB
Text
78 lines
1.9 KiB
Text
create database a;
|
|
use a;
|
|
create table t1(a int);
|
|
insert into t1 values(1);
|
|
create table t2(a int);
|
|
insert into t2 values(1);
|
|
create database b;
|
|
use b;
|
|
create table t1(a int);
|
|
insert into t1 values(1);
|
|
create table t2(a int);
|
|
insert into t2 values(1);
|
|
create database c;
|
|
use c;
|
|
create table t1(a int);
|
|
insert into t1 values(1);
|
|
create table t2(a int);
|
|
insert into t2 values(1);
|
|
change master 'm1' to master_port=MYPORT_1 , master_host='127.0.0.1', master_user='root';
|
|
change master 'm2' to master_port=MYPORT_2 , master_host='127.0.0.1', master_user='root';
|
|
change master to master_port=MYPORT_3 , master_host='127.0.0.1', master_user='root';
|
|
start all slaves;
|
|
set default_master_connection = 'm1';
|
|
include/wait_for_slave_to_start.inc
|
|
set default_master_connection = 'm2';
|
|
include/wait_for_slave_to_start.inc
|
|
set default_master_connection = '';
|
|
include/wait_for_slave_to_start.inc
|
|
use a;
|
|
show tables;
|
|
Tables_in_a
|
|
t1
|
|
t2
|
|
use b;
|
|
show tables;
|
|
Tables_in_b
|
|
t1
|
|
t2
|
|
use c;
|
|
show tables;
|
|
Tables_in_c
|
|
t1
|
|
t2
|
|
#TEST
|
|
SET default_master_connection = "m1";
|
|
SET default_master_connection = "m2";
|
|
SET default_master_connection = "";
|
|
flush logs;
|
|
SET default_master_connection = "m1";
|
|
#log Rotated
|
|
mysqld-relay-bin.000002
|
|
mysqld-relay-bin.000003
|
|
mysqld-relay-bin.index
|
|
SET default_master_connection = "m2";
|
|
#log Rotated
|
|
mysqld-relay-bin-m1.000002
|
|
mysqld-relay-bin-m1.000003
|
|
mysqld-relay-bin-m1.index
|
|
SET default_master_connection = "";
|
|
#log Rotated
|
|
mysqld-relay-bin-m2.000002
|
|
mysqld-relay-bin-m2.000003
|
|
mysqld-relay-bin-m2.index
|
|
#CleanUp
|
|
drop database a;
|
|
drop database b;
|
|
drop database c;
|
|
stop all slaves;
|
|
Warnings:
|
|
Note 1938 SLAVE 'm2' stopped
|
|
Note 1938 SLAVE '' stopped
|
|
Note 1938 SLAVE 'm1' stopped
|
|
SET default_master_connection = "m1";
|
|
include/wait_for_slave_to_stop.inc
|
|
SET default_master_connection = "m2";
|
|
include/wait_for_slave_to_stop.inc
|
|
SET default_master_connection = "";
|
|
include/wait_for_slave_to_stop.inc
|