mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-6676: Optimistic parallel replication
Adjust the configuration options, as discussed on the maria-developers@ mailing list. The option to hint a transaction to not be replicated in parallel is now called @@skip_parallel_replication, consistent with @@skip_replication. And the --slave-parallel-mode is now simplified to have just one of the following values: none minimal conservative optimistic aggressive This reflects successively harder efforts to find opportunities to run things in parallel on the slave. It allows to extend the server with more automatic heuristics in the future without having to introduce a new configuration option for each and every one.
This commit is contained in:
@@ -18,7 +18,7 @@ SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
|
||||
SET GLOBAL slave_parallel_threads=10;
|
||||
CHANGE MASTER TO master_use_gtid=slave_pos;
|
||||
SET @old_parallel_mode=@@GLOBAL.slave_parallel_mode;
|
||||
SET GLOBAL slave_parallel_mode='domain,transactional,waiting';
|
||||
SET GLOBAL slave_parallel_mode='optimistic';
|
||||
|
||||
|
||||
--connection server_3
|
||||
@@ -29,7 +29,7 @@ SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
|
||||
SET GLOBAL slave_parallel_threads=10;
|
||||
CHANGE MASTER TO master_use_gtid=slave_pos;
|
||||
SET @old_parallel_mode=@@GLOBAL.slave_parallel_mode;
|
||||
SET GLOBAL slave_parallel_mode='domain,transactional,waiting';
|
||||
SET GLOBAL slave_parallel_mode='optimistic';
|
||||
|
||||
|
||||
--connection server_4
|
||||
@@ -39,10 +39,10 @@ SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
|
||||
SET GLOBAL slave_parallel_threads=10;
|
||||
CHANGE MASTER TO master_use_gtid=slave_pos;
|
||||
SET @old_parallel_mode=@@GLOBAL.slave_parallel_mode;
|
||||
SET GLOBAL slave_parallel_mode='domain,transactional,waiting';
|
||||
SET GLOBAL slave_parallel_mode='optimistic';
|
||||
|
||||
|
||||
--echo *** MDEV-6676: Test that @@replicate_allow_parallel is preserved in slave binlog ***
|
||||
--echo *** MDEV-6676: Test that @@skip_parallel_replication is preserved in slave binlog ***
|
||||
--connection server_1
|
||||
|
||||
INSERT INTO t1 VALUES(1,1);
|
||||
@@ -52,10 +52,10 @@ INSERT INTO t1 VALUES(3,1);
|
||||
COMMIT;
|
||||
# Do a lot of updates on same row in sequence. These would be likely to cause
|
||||
# conflicts and rollbacks in optimistic parallel replication, but we disable
|
||||
# that by disabling @@replicate_allow_parallel. We can test that the flag is
|
||||
# that by enabling @@skip_parallel_replication. We can test that the flag is
|
||||
# preserved down the replication hierarchy by checking that no slave retries
|
||||
# are made.
|
||||
SET SESSION replicate_allow_parallel=0;
|
||||
SET SESSION skip_parallel_replication=1;
|
||||
UPDATE t1 SET b=b+1 WHERE a=2;
|
||||
UPDATE t1 SET b=b+1 WHERE a=2;
|
||||
UPDATE t1 SET b=b+1 WHERE a=2;
|
||||
@@ -66,7 +66,7 @@ UPDATE t1 SET b=b+1 WHERE a=2;
|
||||
UPDATE t1 SET b=b+1 WHERE a=2;
|
||||
UPDATE t1 SET b=b+1 WHERE a=2;
|
||||
UPDATE t1 SET b=b+1 WHERE a=2;
|
||||
SET SESSION replicate_allow_parallel=1;
|
||||
SET SESSION skip_parallel_replication=0;
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
--source include/save_master_gtid.inc
|
||||
|
||||
@@ -112,19 +112,19 @@ eval SELECT IF($retry1=$retry2, "Ok, no retry",
|
||||
--connection server_2
|
||||
--source include/stop_slave.inc
|
||||
CHANGE MASTER TO master_use_gtid=slave_pos;
|
||||
SET GLOBAL slave_parallel_mode='domain,transactional';
|
||||
SET GLOBAL slave_parallel_mode='optimistic';
|
||||
|
||||
|
||||
--connection server_3
|
||||
--source include/stop_slave.inc
|
||||
CHANGE MASTER TO master_use_gtid=slave_pos;
|
||||
SET GLOBAL slave_parallel_mode='domain,transactional';
|
||||
SET GLOBAL slave_parallel_mode='optimistic';
|
||||
|
||||
|
||||
--connection server_4
|
||||
--source include/stop_slave.inc
|
||||
CHANGE MASTER TO master_use_gtid=slave_pos;
|
||||
SET GLOBAL slave_parallel_mode='domain,transactional';
|
||||
SET GLOBAL slave_parallel_mode='optimistic';
|
||||
|
||||
--connection server_1
|
||||
# Do a lot of updates on same row in sequence. Ensure that all of these but the
|
||||
|
Reference in New Issue
Block a user