[Commits] 6f8753b: MDEV-6676: Optimistic parallel replication

Kristian Nielsen knielsen at knielsen-hq.org
Fri Feb 6 11:07:02 EET 2015


revision-id: 6f8753b03b02c1a8744da0d8db82383add604ce4
parent(s): 28cfc46872dba676fec539c2f32b49ab37dc614e
committer: Kristian Nielsen
branch nick: server
timestamp: 2015-02-06 10:02:02 +0100
message:

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.

---
 mysql-test/include/check-testcase.test             |    2 +-
 mysql-test/r/mysqld--help.result                   |   19 +++---
 .../suite/binlog/r/binlog_mysqlbinlog_row.result   |    2 +-
 .../binlog/r/binlog_mysqlbinlog_row_innodb.result  |    8 +--
 .../binlog/r/binlog_mysqlbinlog_row_myisam.result  |    8 +--
 .../binlog/r/binlog_mysqlbinlog_row_trans.result   |    2 +-
 .../suite/binlog/r/binlog_row_annotate.result      |   12 ++--
 .../binlog/r/binlog_row_mysqlbinlog_options.result |    4 +-
 mysql-test/suite/rpl/r/rpl_parallel.result         |   18 +++---
 .../suite/rpl/r/rpl_parallel_multilevel.result     |   18 +++---
 .../suite/rpl/r/rpl_parallel_optimistic.result     |    8 +--
 .../rpl/r/rpl_parallel_optimistic_nobinlog.result  |    2 +-
 mysql-test/suite/rpl/t/rpl_parallel.test           |   12 ++--
 .../suite/rpl/t/rpl_parallel_multilevel.test       |   20 +++----
 .../suite/rpl/t/rpl_parallel_optimistic.test       |   10 ++--
 .../rpl/t/rpl_parallel_optimistic_nobinlog.test    |    2 +-
 .../r/replicate_allow_parallel_basic.result        |   15 -----
 .../r/skip_parallel_replication_basic.result       |   15 +++++
 .../sys_vars/r/slave_parallel_mode_basic.result    |   30 +++++-----
 .../sys_vars/r/sysvars_server_notembedded.result   |   38 ++++++------
 .../sys_vars/t/replicate_allow_parallel_basic.test |   14 -----
 .../t/skip_parallel_replication_basic.test         |   14 +++++
 .../t/slave_parallel_mode_basic-master.opt         |    2 +-
 .../sys_vars/t/slave_parallel_mode_basic.test      |    8 +--
 sql/log_event.cc                                   |   10 ++--
 sql/log_event.h                                    |    4 +-
 sql/mysqld.cc                                      |   24 ++++----
 sql/mysqld.h                                       |   16 ++---
 sql/rpl_filter.cc                                  |    2 +-
 sql/rpl_filter.h                                   |    7 ++-
 sql/rpl_mi.h                                       |   11 ++--
 sql/rpl_parallel.cc                                |   15 ++---
 sql/share/errmsg-utf8.txt                          |    4 +-
 sql/slave.cc                                       |   21 ++-----
 sql/sql_priv.h                                     |    2 +-
 sql/sys_vars.cc                                    |   62 +++++++++-----------
 sql/sys_vars.h                                     |    9 +--
 37 files changed, 224 insertions(+), 246 deletions(-)

diff --git a/mysql-test/include/check-testcase.test b/mysql-test/include/check-testcase.test
index 9bba18b..083f44c 100644
--- a/mysql-test/include/check-testcase.test
+++ b/mysql-test/include/check-testcase.test
@@ -66,7 +66,7 @@ if ($tmp)
   --echo Gtid_IO_Pos	#
   --echo Replicate_Do_Domain_Ids	
   --echo Replicate_Ignore_Domain_Ids	
-  --echo Parallel_Mode	domain,follow_master_commit
+  --echo Parallel_Mode	conservative
 }
 if (!$tmp) {
   # Note: after WL#5177, fields 13-18 shall not be filtered-out.
diff --git a/mysql-test/r/mysqld--help.result b/mysql-test/r/mysqld--help.result
index bcda25c..dc2f2b3 100644
--- a/mysql-test/r/mysqld--help.result
+++ b/mysql-test/r/mysqld--help.result
@@ -922,15 +922,14 @@ The following options may be given as the first argument:
  replication. Only used when --slave-parallel-threads > 0.
  --slave-parallel-mode=name 
  Controls what transactions are applied in parallel when
- using --slave-parallel-threads. Syntax:
- slave_parallel_mode=value[,value...], where "value" could
- be one or more of: "domain", to apply different
- replication domains in parallel; "follow_master_commit",
- to apply in parallel transactions that group-committed
- together on the master; "transactional", to
- optimistically try to apply all transactional DML in
- parallel; and "waiting" to extend "transactional" to even
- transactions that had to wait on the master.
+ using --slave-parallel-threads. Possible values:
+ "optimistic" tries to apply most transactional DML in
+ parallel, and handles any conflicts with rollback and
+ retry. "conservative" limits parallelism in an effort to
+ avoid any conflicts. "aggressive" tries to maximise the
+ parallelism, possibly at the cost of increased conflict
+ rate. "minimal" only parallelizes the commit steps of
+ transactions. "none" disables parallel apply completely.
  --slave-parallel-threads=# 
  If non-zero, number of threads to spawn to apply in
  parallel events on the slave that were group-committed on
@@ -1351,7 +1350,7 @@ slave-exec-mode STRICT
 slave-max-allowed-packet 1073741824
 slave-net-timeout 3600
 slave-parallel-max-queued 131072
-slave-parallel-mode domain,follow_master_commit
+slave-parallel-mode conservative
 slave-parallel-threads 0
 slave-run-triggers-for-rbr NO
 slave-skip-errors (No default value)
diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result
index 40ebbbc..714c01d 100644
--- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result
@@ -341,7 +341,7 @@ ROLLBACK/*!*/;
 #010909  4:46:40 server id 1  end_log_pos # 	Binlog checkpoint master-bin.000001
 # at #
 #010909  4:46:40 server id 1  end_log_pos # 	GTID 0-1-1 ddl
-/*!100101 SET @@session.replicate_allow_parallel=1*//*!*/;
+/*!100101 SET @@session.skip_parallel_replication=0*//*!*/;
 /*!100001 SET @@session.gtid_domain_id=0*//*!*/;
 /*!100001 SET @@session.server_id=1*//*!*/;
 /*!100001 SET @@session.gtid_seq_no=1*//*!*/;
diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result
index 2522e1a..21b3d4f 100644
--- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result
@@ -2258,7 +2258,7 @@ ROLLBACK/*!*/;
 #010909  4:46:40 server id 1  end_log_pos # 	Binlog checkpoint master-bin.000001
 # at #
 #010909  4:46:40 server id 1  end_log_pos # 	GTID 0-1-1 ddl
-/*!100101 SET @@session.replicate_allow_parallel=1*//*!*/;
+/*!100101 SET @@session.skip_parallel_replication=0*//*!*/;
 /*!100001 SET @@session.gtid_domain_id=0*//*!*/;
 /*!100001 SET @@session.server_id=1*//*!*/;
 /*!100001 SET @@session.gtid_seq_no=1*//*!*/;
@@ -3892,7 +3892,7 @@ ROLLBACK/*!*/;
 #010909  4:46:40 server id 1  end_log_pos # 	Binlog checkpoint master-bin.000001
 # at #
 #010909  4:46:40 server id 1  end_log_pos # 	GTID 0-1-1 ddl
-/*!100101 SET @@session.replicate_allow_parallel=1*//*!*/;
+/*!100101 SET @@session.skip_parallel_replication=0*//*!*/;
 /*!100001 SET @@session.gtid_domain_id=0*//*!*/;
 /*!100001 SET @@session.server_id=1*//*!*/;
 /*!100001 SET @@session.gtid_seq_no=1*//*!*/;
@@ -4271,7 +4271,7 @@ ROLLBACK/*!*/;
 #010909  4:46:40 server id 1  end_log_pos # 	Binlog checkpoint master-bin.000001
 # at #
 #010909  4:46:40 server id 1  end_log_pos # 	GTID 0-1-1 ddl
-/*!100101 SET @@session.replicate_allow_parallel=1*//*!*/;
+/*!100101 SET @@session.skip_parallel_replication=0*//*!*/;
 /*!100001 SET @@session.gtid_domain_id=0*//*!*/;
 /*!100001 SET @@session.server_id=1*//*!*/;
 /*!100001 SET @@session.gtid_seq_no=1*//*!*/;
@@ -4850,7 +4850,7 @@ ROLLBACK/*!*/;
 #010909  4:46:40 server id 1  end_log_pos # 	Binlog checkpoint master-bin.000001
 # at #
 #010909  4:46:40 server id 1  end_log_pos # 	GTID 0-1-1 ddl
-/*!100101 SET @@session.replicate_allow_parallel=1*//*!*/;
+/*!100101 SET @@session.skip_parallel_replication=0*//*!*/;
 /*!100001 SET @@session.gtid_domain_id=0*//*!*/;
 /*!100001 SET @@session.server_id=1*//*!*/;
 /*!100001 SET @@session.gtid_seq_no=1*//*!*/;
diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result
index d14251d..5dea7c7 100644
--- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result
@@ -2258,7 +2258,7 @@ ROLLBACK/*!*/;
 #010909  4:46:40 server id 1  end_log_pos # 	Binlog checkpoint master-bin.000001
 # at #
 #010909  4:46:40 server id 1  end_log_pos # 	GTID 0-1-1 ddl
-/*!100101 SET @@session.replicate_allow_parallel=1*//*!*/;
+/*!100101 SET @@session.skip_parallel_replication=0*//*!*/;
 /*!100001 SET @@session.gtid_domain_id=0*//*!*/;
 /*!100001 SET @@session.server_id=1*//*!*/;
 /*!100001 SET @@session.gtid_seq_no=1*//*!*/;
@@ -3915,7 +3915,7 @@ ROLLBACK/*!*/;
 #010909  4:46:40 server id 1  end_log_pos # 	Binlog checkpoint master-bin.000001
 # at #
 #010909  4:46:40 server id 1  end_log_pos # 	GTID 0-1-1 ddl
-/*!100101 SET @@session.replicate_allow_parallel=1*//*!*/;
+/*!100101 SET @@session.skip_parallel_replication=0*//*!*/;
 /*!100001 SET @@session.gtid_domain_id=0*//*!*/;
 /*!100001 SET @@session.server_id=1*//*!*/;
 /*!100001 SET @@session.gtid_seq_no=1*//*!*/;
@@ -4300,7 +4300,7 @@ ROLLBACK/*!*/;
 #010909  4:46:40 server id 1  end_log_pos # 	Binlog checkpoint master-bin.000001
 # at #
 #010909  4:46:40 server id 1  end_log_pos # 	GTID 0-1-1 ddl
-/*!100101 SET @@session.replicate_allow_parallel=1*//*!*/;
+/*!100101 SET @@session.skip_parallel_replication=0*//*!*/;
 /*!100001 SET @@session.gtid_domain_id=0*//*!*/;
 /*!100001 SET @@session.server_id=1*//*!*/;
 /*!100001 SET @@session.gtid_seq_no=1*//*!*/;
@@ -4889,7 +4889,7 @@ ROLLBACK/*!*/;
 #010909  4:46:40 server id 1  end_log_pos # 	Binlog checkpoint master-bin.000001
 # at #
 #010909  4:46:40 server id 1  end_log_pos # 	GTID 0-1-1 ddl
-/*!100101 SET @@session.replicate_allow_parallel=1*//*!*/;
+/*!100101 SET @@session.skip_parallel_replication=0*//*!*/;
 /*!100001 SET @@session.gtid_domain_id=0*//*!*/;
 /*!100001 SET @@session.server_id=1*//*!*/;
 /*!100001 SET @@session.gtid_seq_no=1*//*!*/;
diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result
index 8275961..ad1a6ed 100644
--- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result
@@ -137,7 +137,7 @@ ROLLBACK/*!*/;
 #010909  4:46:40 server id 1  end_log_pos # 	Binlog checkpoint master-bin.000001
 # at #
 #010909  4:46:40 server id 1  end_log_pos # 	GTID 0-1-1 ddl
-/*!100101 SET @@session.replicate_allow_parallel=1*//*!*/;
+/*!100101 SET @@session.skip_parallel_replication=0*//*!*/;
 /*!100001 SET @@session.gtid_domain_id=0*//*!*/;
 /*!100001 SET @@session.server_id=1*//*!*/;
 /*!100001 SET @@session.gtid_seq_no=1*//*!*/;
diff --git a/mysql-test/suite/binlog/r/binlog_row_annotate.result b/mysql-test/suite/binlog/r/binlog_row_annotate.result
index 4fcbc26..2d1e3b9 100644
--- a/mysql-test/suite/binlog/r/binlog_row_annotate.result
+++ b/mysql-test/suite/binlog/r/binlog_row_annotate.result
@@ -81,7 +81,7 @@ ROLLBACK/*!*/;
 #010909  4:46:40 server id #  end_log_pos # 	Binlog checkpoint master-bin.000001
 # at #
 #010909  4:46:40 server id #  end_log_pos # 	GTID 0-1-1 ddl
-/*!100101 SET @@session.replicate_allow_parallel=1*//*!*/;
+/*!100101 SET @@session.skip_parallel_replication=0*//*!*/;
 /*!100001 SET @@session.gtid_domain_id=0*//*!*/;
 /*!100001 SET @@session.server_id=1*//*!*/;
 /*!100001 SET @@session.gtid_seq_no=1*//*!*/;
@@ -334,7 +334,7 @@ ROLLBACK/*!*/;
 #010909  4:46:40 server id #  end_log_pos # 	Binlog checkpoint master-bin.000001
 # at #
 #010909  4:46:40 server id #  end_log_pos # 	GTID 0-1-1 ddl
-/*!100101 SET @@session.replicate_allow_parallel=1*//*!*/;
+/*!100101 SET @@session.skip_parallel_replication=0*//*!*/;
 /*!100001 SET @@session.gtid_domain_id=0*//*!*/;
 /*!100001 SET @@session.server_id=1*//*!*/;
 /*!100001 SET @@session.gtid_seq_no=1*//*!*/;
@@ -506,7 +506,7 @@ ROLLBACK/*!*/;
 #010909  4:46:40 server id #  end_log_pos # 	Binlog checkpoint master-bin.000001
 # at #
 #010909  4:46:40 server id #  end_log_pos # 	GTID 0-1-1 ddl
-/*!100101 SET @@session.replicate_allow_parallel=1*//*!*/;
+/*!100101 SET @@session.skip_parallel_replication=0*//*!*/;
 /*!100001 SET @@session.gtid_domain_id=0*//*!*/;
 /*!100001 SET @@session.server_id=1*//*!*/;
 /*!100001 SET @@session.gtid_seq_no=1*//*!*/;
@@ -749,7 +749,7 @@ ROLLBACK/*!*/;
 #010909  4:46:40 server id #  end_log_pos # 	Binlog checkpoint master-bin.000001
 # at #
 #010909  4:46:40 server id #  end_log_pos # 	GTID 0-1-1 ddl
-/*!100101 SET @@session.replicate_allow_parallel=1*//*!*/;
+/*!100101 SET @@session.skip_parallel_replication=0*//*!*/;
 /*!100001 SET @@session.gtid_domain_id=0*//*!*/;
 /*!100001 SET @@session.server_id=1*//*!*/;
 /*!100001 SET @@session.gtid_seq_no=1*//*!*/;
@@ -1002,7 +1002,7 @@ ROLLBACK/*!*/;
 #010909  4:46:40 server id #  end_log_pos # 	Binlog checkpoint master-bin.000001
 # at #
 #010909  4:46:40 server id #  end_log_pos # 	GTID 0-1-1 ddl
-/*!100101 SET @@session.replicate_allow_parallel=1*//*!*/;
+/*!100101 SET @@session.skip_parallel_replication=0*//*!*/;
 /*!100001 SET @@session.gtid_domain_id=0*//*!*/;
 /*!100001 SET @@session.server_id=1*//*!*/;
 /*!100001 SET @@session.gtid_seq_no=1*//*!*/;
@@ -1174,7 +1174,7 @@ ROLLBACK/*!*/;
 #010909  4:46:40 server id #  end_log_pos # 	Binlog checkpoint master-bin.000001
 # at #
 #010909  4:46:40 server id #  end_log_pos # 	GTID 0-1-1 ddl
-/*!100101 SET @@session.replicate_allow_parallel=1*//*!*/;
+/*!100101 SET @@session.skip_parallel_replication=0*//*!*/;
 /*!100001 SET @@session.gtid_domain_id=0*//*!*/;
 /*!100001 SET @@session.server_id=1*//*!*/;
 /*!100001 SET @@session.gtid_seq_no=1*//*!*/;
diff --git a/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result b/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result
index 2447179..f272292 100644
--- a/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result
+++ b/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result
@@ -41,7 +41,7 @@ ROLLBACK/*!*/;
 #010909  4:46:40 server id #  end_log_pos # 	Binlog checkpoint master-bin.000001
 # at #
 #010909  4:46:40 server id #  end_log_pos # 	GTID 0-1-1 ddl
-/*!100101 SET @@session.replicate_allow_parallel=1*//*!*/;
+/*!100101 SET @@session.skip_parallel_replication=0*//*!*/;
 /*!100001 SET @@session.gtid_domain_id=0*//*!*/;
 /*!100001 SET @@session.server_id=1*//*!*/;
 /*!100001 SET @@session.gtid_seq_no=1*//*!*/;
@@ -253,7 +253,7 @@ ROLLBACK/*!*/;
 #010909  4:46:40 server id #  end_log_pos # 	Binlog checkpoint master-bin.000001
 # at #
 #010909  4:46:40 server id #  end_log_pos # 	GTID 0-1-1 ddl
-/*!100101 SET @@session.replicate_allow_parallel=1*//*!*/;
+/*!100101 SET @@session.skip_parallel_replication=0*//*!*/;
 /*!100001 SET @@session.gtid_domain_id=0*//*!*/;
 /*!100001 SET @@session.server_id=1*//*!*/;
 /*!100001 SET @@session.gtid_seq_no=1*//*!*/;
diff --git a/mysql-test/suite/rpl/r/rpl_parallel.result b/mysql-test/suite/rpl/r/rpl_parallel.result
index a49d1f3..34eaa48 100644
--- a/mysql-test/suite/rpl/r/rpl_parallel.result
+++ b/mysql-test/suite/rpl/r/rpl_parallel.result
@@ -1138,18 +1138,16 @@ SET GLOBAL slave_parallel_threads=0;
 SET GLOBAL slave_parallel_threads=10;
 include/start_slave.inc
 *** MDEV-6676 - test syntax of @@slave_parallel_mode ***
-Parallel_Mode = 'domain,follow_master_commit'
+Parallel_Mode = 'conservative'
 include/stop_slave.inc
-SET GLOBAL slave_parallel_mode='domain,follow_master_commit,transactional';
-ERROR HY000: Invalid use of 'transactional' option for slave_parallel_mode
-SET GLOBAL slave_parallel_mode='waiting,transactional,domain';
-Parallel_Mode = 'domain,transactional,waiting'
-SET GLOBAL slave_parallel_mode='domain,follow_master_commit';
-Parallel_Mode = 'domain,follow_master_commit'
+SET GLOBAL slave_parallel_mode='aggressive';
+Parallel_Mode = 'aggressive'
+SET GLOBAL slave_parallel_mode='conservative';
+Parallel_Mode = 'conservative'
 *** MDEV-6676 - test that empty parallel_mode does not replicate in parallel ***
 INSERT INTO t2 VALUES (1040);
 include/save_master_gtid.inc
-SET GLOBAL slave_parallel_mode='';
+SET GLOBAL slave_parallel_mode='none';
 SET @old_dbug= @@GLOBAL.debug_dbug;
 SET GLOBAL debug_dbug="+d,slave_crash_if_parallel_apply";
 include/start_slave.inc
@@ -1177,7 +1175,7 @@ INSERT INTO t2 VALUES (1045);
 INSERT INTO t2 VALUES (1046);
 SET gtid_domain_id = 0;
 include/save_master_gtid.inc
-SET GLOBAL slave_parallel_mode=follow_master_commit;
+SET GLOBAL slave_parallel_mode=minimal;
 include/start_slave.inc
 include/sync_with_master_gtid.inc
 SELECT * FROM t2 WHERE a >= 1040 ORDER BY a;
@@ -1190,7 +1188,7 @@ a
 1045
 1046
 include/stop_slave.inc
-SET GLOBAL slave_parallel_mode='domain,follow_master_commit';
+SET GLOBAL slave_parallel_mode='conservative';
 include/start_slave.inc
 include/stop_slave.inc
 SET GLOBAL slave_parallel_threads=@old_parallel_threads;
diff --git a/mysql-test/suite/rpl/r/rpl_parallel_multilevel.result b/mysql-test/suite/rpl/r/rpl_parallel_multilevel.result
index fe45abd..ae9389c 100644
--- a/mysql-test/suite/rpl/r/rpl_parallel_multilevel.result
+++ b/mysql-test/suite/rpl/r/rpl_parallel_multilevel.result
@@ -6,26 +6,26 @@ include/stop_slave.inc
 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';
 SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
 include/stop_slave.inc
 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';
 SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
 include/stop_slave.inc
 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';
-*** MDEV-6676: Test that @@replicate_allow_parallel is preserved in slave binlog ***
+SET GLOBAL slave_parallel_mode='optimistic';
+*** MDEV-6676: Test that @@skip_parallel_replication is preserved in slave binlog ***
 INSERT INTO t1 VALUES(1,1);
 BEGIN;
 INSERT INTO t1 VALUES(2,1);
 INSERT INTO t1 VALUES(3,1);
 COMMIT;
-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;
@@ -36,7 +36,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;
 a	b
 1	1
@@ -73,13 +73,13 @@ Ok, no retry
 *** MDEV-6676: Test that the FL_WAITED flag in GTID is preserved in slave binlog ***
 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';
 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';
 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';
 BEGIN;
 UPDATE t1 SET b=b+1 WHERE a=2;
 SET debug_sync="thd_report_wait_for SIGNAL waiting1";
diff --git a/mysql-test/suite/rpl/r/rpl_parallel_optimistic.result b/mysql-test/suite/rpl/r/rpl_parallel_optimistic.result
index 1f885c7..2c34a54 100644
--- a/mysql-test/suite/rpl/r/rpl_parallel_optimistic.result
+++ b/mysql-test/suite/rpl/r/rpl_parallel_optimistic.result
@@ -6,7 +6,7 @@ include/stop_slave.inc
 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';
+SET GLOBAL slave_parallel_mode='optimistic';
 INSERT INTO t1 VALUES(1,1);
 BEGIN;
 INSERT INTO t1 VALUES(2,1);
@@ -121,10 +121,10 @@ c
 204
 205
 206
-*** Test @@replicate_allow_parallel. ***
+*** Test @@skip_parallel_replication. ***
 include/stop_slave.inc
 UPDATE t1 SET b=10 WHERE a=3;
-SET SESSION replicate_allow_parallel=0;
+SET SESSION skip_parallel_replication=1;
 UPDATE t1 SET b=20 WHERE a=3;
 UPDATE t1 SET b=30 WHERE a=3;
 UPDATE t1 SET b=50 WHERE a=3;
@@ -134,7 +134,7 @@ UPDATE t1 SET b=210 WHERE a=3;
 UPDATE t1 SET b=340 WHERE a=3;
 UPDATE t1 SET b=550 WHERE a=3;
 UPDATE t1 SET b=890 WHERE a=3;
-SET SESSION replicate_allow_parallel=1;
+SET SESSION skip_parallel_replication=0;
 SELECT * FROM t1 ORDER BY a;
 a	b
 1	2
diff --git a/mysql-test/suite/rpl/r/rpl_parallel_optimistic_nobinlog.result b/mysql-test/suite/rpl/r/rpl_parallel_optimistic_nobinlog.result
index d51eb29..91970f3 100644
--- a/mysql-test/suite/rpl/r/rpl_parallel_optimistic_nobinlog.result
+++ b/mysql-test/suite/rpl/r/rpl_parallel_optimistic_nobinlog.result
@@ -11,7 +11,7 @@ SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED;
 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='aggressive';
 *** Test that we replicate correctly when using READ COMMITTED and --log-slave-updates=0 on the slave ***
 INSERT INTO t1 SELECT 4, COUNT(*) FROM t2;
 INSERT INTO t2 SELECT 4, COUNT(*) FROM t1;
diff --git a/mysql-test/suite/rpl/t/rpl_parallel.test b/mysql-test/suite/rpl/t/rpl_parallel.test
index 2f5a45d..3711e83 100644
--- a/mysql-test/suite/rpl/t/rpl_parallel.test
+++ b/mysql-test/suite/rpl/t/rpl_parallel.test
@@ -1847,12 +1847,10 @@ SET GLOBAL slave_parallel_threads=10;
 --let $status_items= Parallel_Mode
 --source include/show_slave_status.inc
 --source include/stop_slave.inc
---error ER_INVALID_SLAVE_PARALLEL_MODE
-SET GLOBAL slave_parallel_mode='domain,follow_master_commit,transactional';
-SET GLOBAL slave_parallel_mode='waiting,transactional,domain';
+SET GLOBAL slave_parallel_mode='aggressive';
 --let $status_items= Parallel_Mode
 --source include/show_slave_status.inc
-SET GLOBAL slave_parallel_mode='domain,follow_master_commit';
+SET GLOBAL slave_parallel_mode='conservative';
 --let $status_items= Parallel_Mode
 --source include/show_slave_status.inc
 
@@ -1863,7 +1861,7 @@ INSERT INTO t2 VALUES (1040);
 --source include/save_master_gtid.inc
 
 --connection server_2
-SET GLOBAL slave_parallel_mode='';
+SET GLOBAL slave_parallel_mode='none';
 # Test that we do not use parallel apply, by injecting an unconditional
 # crash in the parallel apply code.
 SET @old_dbug= @@GLOBAL.debug_dbug;
@@ -1897,12 +1895,12 @@ INSERT INTO t2 VALUES (1046);
 SET gtid_domain_id = 0;
 --source include/save_master_gtid.inc
 --connection server_2
-SET GLOBAL slave_parallel_mode=follow_master_commit;
+SET GLOBAL slave_parallel_mode=minimal;
 --source include/start_slave.inc
 --source include/sync_with_master_gtid.inc
 SELECT * FROM t2 WHERE a >= 1040 ORDER BY a;
 --source include/stop_slave.inc
-SET GLOBAL slave_parallel_mode='domain,follow_master_commit';
+SET GLOBAL slave_parallel_mode='conservative';
 --source include/start_slave.inc
 
 
diff --git a/mysql-test/suite/rpl/t/rpl_parallel_multilevel.test b/mysql-test/suite/rpl/t/rpl_parallel_multilevel.test
index 8f6ae7f..168b7ea 100644
--- a/mysql-test/suite/rpl/t/rpl_parallel_multilevel.test
+++ b/mysql-test/suite/rpl/t/rpl_parallel_multilevel.test
@@ -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
diff --git a/mysql-test/suite/rpl/t/rpl_parallel_optimistic.test b/mysql-test/suite/rpl/t/rpl_parallel_optimistic.test
index c1f3558..7afeb9e 100644
--- a/mysql-test/suite/rpl/t/rpl_parallel_optimistic.test
+++ b/mysql-test/suite/rpl/t/rpl_parallel_optimistic.test
@@ -15,7 +15,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';
+SET GLOBAL slave_parallel_mode='optimistic';
 
 
 --connection server_1
@@ -106,7 +106,7 @@ SELECT * FROM t3 ORDER BY c;
 #SHOW STATUS LIKE 'Slave_retried_transactions';
 
 
---echo *** Test @@replicate_allow_parallel. ***
+--echo *** Test @@skip_parallel_replication. ***
 
 --connection server_2
 --source include/stop_slave.inc
@@ -114,11 +114,11 @@ SELECT * FROM t3 ORDER BY c;
 
 --connection server_1
 # We do a bunch of conflicting transactions on the master with
-# replicate_allow_parallel set to false, and check that we do not
+# skip_parallel_replication set to true, and check that we do not
 # get any retries on the slave.
 
 UPDATE t1 SET b=10 WHERE a=3;
-SET SESSION replicate_allow_parallel=0;
+SET SESSION skip_parallel_replication=1;
 UPDATE t1 SET b=20 WHERE a=3;
 UPDATE t1 SET b=30 WHERE a=3;
 UPDATE t1 SET b=50 WHERE a=3;
@@ -128,7 +128,7 @@ UPDATE t1 SET b=210 WHERE a=3;
 UPDATE t1 SET b=340 WHERE a=3;
 UPDATE t1 SET b=550 WHERE a=3;
 UPDATE t1 SET b=890 WHERE a=3;
-SET SESSION replicate_allow_parallel=1;
+SET SESSION skip_parallel_replication=0;
 SELECT * FROM t1 ORDER BY a;
 --source include/save_master_gtid.inc
 
diff --git a/mysql-test/suite/rpl/t/rpl_parallel_optimistic_nobinlog.test b/mysql-test/suite/rpl/t/rpl_parallel_optimistic_nobinlog.test
index 63a994d..9492414 100644
--- a/mysql-test/suite/rpl/t/rpl_parallel_optimistic_nobinlog.test
+++ b/mysql-test/suite/rpl/t/rpl_parallel_optimistic_nobinlog.test
@@ -21,7 +21,7 @@ SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED;
 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='aggressive';
 
 
 --echo *** Test that we replicate correctly when using READ COMMITTED and --log-slave-updates=0 on the slave ***
diff --git a/mysql-test/suite/sys_vars/r/replicate_allow_parallel_basic.result b/mysql-test/suite/sys_vars/r/replicate_allow_parallel_basic.result
deleted file mode 100644
index f612bb7..0000000
--- a/mysql-test/suite/sys_vars/r/replicate_allow_parallel_basic.result
+++ /dev/null
@@ -1,15 +0,0 @@
-SELECT @@global.replicate_allow_parallel;
-ERROR HY000: Variable 'replicate_allow_parallel' is a SESSION variable
-SET GLOBAL replicate_allow_parallel= 1;
-ERROR HY000: Variable 'replicate_allow_parallel' is a SESSION variable and can't be used with SET GLOBAL
-SELECT @@session.replicate_allow_parallel;
-@@session.replicate_allow_parallel
-1
-SET SESSION replicate_allow_parallel= 0;
-SELECT @@session.replicate_allow_parallel;
-@@session.replicate_allow_parallel
-0
-SET SESSION replicate_allow_parallel= 1;
-SELECT @@session.replicate_allow_parallel;
-@@session.replicate_allow_parallel
-1
diff --git a/mysql-test/suite/sys_vars/r/skip_parallel_replication_basic.result b/mysql-test/suite/sys_vars/r/skip_parallel_replication_basic.result
new file mode 100644
index 0000000..9633318
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/skip_parallel_replication_basic.result
@@ -0,0 +1,15 @@
+SELECT @@global.skip_parallel_replication;
+ERROR HY000: Variable 'skip_parallel_replication' is a SESSION variable
+SET GLOBAL skip_parallel_replication= 0;
+ERROR HY000: Variable 'skip_parallel_replication' is a SESSION variable and can't be used with SET GLOBAL
+SELECT @@session.skip_parallel_replication;
+@@session.skip_parallel_replication
+0
+SET SESSION skip_parallel_replication= 1;
+SELECT @@session.skip_parallel_replication;
+@@session.skip_parallel_replication
+1
+SET SESSION skip_parallel_replication= 0;
+SELECT @@session.skip_parallel_replication;
+@@session.skip_parallel_replication
+0
diff --git a/mysql-test/suite/sys_vars/r/slave_parallel_mode_basic.result b/mysql-test/suite/sys_vars/r/slave_parallel_mode_basic.result
index e997cc4..e4c9134 100644
--- a/mysql-test/suite/sys_vars/r/slave_parallel_mode_basic.result
+++ b/mysql-test/suite/sys_vars/r/slave_parallel_mode_basic.result
@@ -1,8 +1,8 @@
-SET SESSION slave_parallel_mode= '';
+SET SESSION slave_parallel_mode= none;
 ERROR HY000: Variable 'slave_parallel_mode' is a GLOBAL variable and should be set with SET GLOBAL
 SELECT @@slave_parallel_mode;
 @@slave_parallel_mode
-domain
+minimal
 SELECT @@m1.slave_parallel_mode;
 @@m1.slave_parallel_mode
 NULL
@@ -12,39 +12,39 @@ Warning	1617	There is no master connection 'm1'
 CHANGE MASTER TO master_host='127.0.0.1', master_port=3310, master_user='root';
 SELECT @@``.slave_parallel_mode;
 @@``.slave_parallel_mode
-domain
+minimal
 SELECT @@slave_parallel_mode;
 @@slave_parallel_mode
-domain
-Parallel_Mode = 'domain'
+minimal
+Parallel_Mode = 'minimal'
 SELECT @@m2.slave_parallel_mode;
 @@m2.slave_parallel_mode
 NULL
 Warnings:
 Warning	1617	There is no master connection 'm2'
 Warning	1617	There is no master connection 'm2'
-SET GLOBAL m2.slave_parallel_mode = '';
+SET GLOBAL m2.slave_parallel_mode = none;
 Warnings:
 Warning	1617	There is no master connection 'm2'
 CHANGE MASTER 'm1' TO master_host='127.0.0.1', master_port=3311, master_user='root';
 SELECT @@m1.slave_parallel_mode;
 @@m1.slave_parallel_mode
-transactional
-Parallel_Mode = 'domain'
-SET GLOBAL m1.slave_parallel_mode= follow_master_commit;
-Parallel_Mode = 'domain'
+optimistic
+Parallel_Mode = 'minimal'
+SET GLOBAL m1.slave_parallel_mode= conservative;
+Parallel_Mode = 'minimal'
 SET default_master_connection= 'm1';
 SELECT @@slave_parallel_mode;
 @@slave_parallel_mode
-follow_master_commit
-SET GLOBAL slave_parallel_mode= waiting;
+conservative
+SET GLOBAL slave_parallel_mode= aggressive;
 SELECT @@slave_parallel_mode;
 @@slave_parallel_mode
-waiting
-Parallel_Mode = 'waiting'
+aggressive
+Parallel_Mode = 'aggressive'
 SET default_master_connection= '';
 SELECT @@slave_parallel_mode;
 @@slave_parallel_mode
-domain
+minimal
 RESET SLAVE ALL;
 RESET SLAVE 'm1' ALL;
diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
index 07e86e4..8a793ea 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
@@ -3395,20 +3395,6 @@ NUMERIC_BLOCK_SIZE	1
 ENUM_VALUE_LIST	NULL
 READ_ONLY	YES
 COMMAND_LINE_ARGUMENT	REQUIRED
-VARIABLE_NAME	REPLICATE_ALLOW_PARALLEL
-SESSION_VALUE	ON
-GLOBAL_VALUE	NULL
-GLOBAL_VALUE_ORIGIN	COMPILE-TIME
-DEFAULT_VALUE	ON
-VARIABLE_SCOPE	SESSION ONLY
-VARIABLE_TYPE	BOOLEAN
-VARIABLE_COMMENT	If set when a transaction is written to the binlog, that transaction is allowed to replicate in parallel on a slave where slave_parallel_mode is set to "transactional". Can be cleared for transactions that are likely to cause a conflict if replicated in parallel, to avoid unnecessary rollback and retry.
-NUMERIC_MIN_VALUE	NULL
-NUMERIC_MAX_VALUE	NULL
-NUMERIC_BLOCK_SIZE	NULL
-ENUM_VALUE_LIST	OFF,ON
-READ_ONLY	NO
-COMMAND_LINE_ARGUMENT	NULL
 VARIABLE_NAME	REPLICATE_ANNOTATE_ROW_EVENTS
 SESSION_VALUE	NULL
 GLOBAL_VALUE	OFF
@@ -3675,6 +3661,20 @@ NUMERIC_BLOCK_SIZE	NULL
 ENUM_VALUE_LIST	OFF,ON
 READ_ONLY	YES
 COMMAND_LINE_ARGUMENT	OPTIONAL
+VARIABLE_NAME	SKIP_PARALLEL_REPLICATION
+SESSION_VALUE	OFF
+GLOBAL_VALUE	NULL
+GLOBAL_VALUE_ORIGIN	COMPILE-TIME
+DEFAULT_VALUE	OFF
+VARIABLE_SCOPE	SESSION ONLY
+VARIABLE_TYPE	BOOLEAN
+VARIABLE_COMMENT	If set when a transaction is written to the binlog, parallel apply of that transaction will be avoided on a slave where slave_parallel_mode is not "aggressive". Can be used to avoid unnecessary rollback and retry for transactions that are likely to cause a conflict if replicated in parallel.
+NUMERIC_MIN_VALUE	NULL
+NUMERIC_MAX_VALUE	NULL
+NUMERIC_BLOCK_SIZE	NULL
+ENUM_VALUE_LIST	OFF,ON
+READ_ONLY	NO
+COMMAND_LINE_ARGUMENT	NULL
 VARIABLE_NAME	SKIP_REPLICATION
 SESSION_VALUE	OFF
 GLOBAL_VALUE	NULL
@@ -3817,16 +3817,16 @@ READ_ONLY	NO
 COMMAND_LINE_ARGUMENT	REQUIRED
 VARIABLE_NAME	SLAVE_PARALLEL_MODE
 SESSION_VALUE	NULL
-GLOBAL_VALUE	domain,follow_master_commit
+GLOBAL_VALUE	conservative
 GLOBAL_VALUE_ORIGIN	COMPILE-TIME
-DEFAULT_VALUE	domain,follow_master_commit
+DEFAULT_VALUE	conservative
 VARIABLE_SCOPE	GLOBAL
-VARIABLE_TYPE	SET
-VARIABLE_COMMENT	Controls what transactions are applied in parallel when using --slave-parallel-threads. Syntax: slave_parallel_mode=value[,value...], where "value" could be one or more of: "domain", to apply different replication domains in parallel; "follow_master_commit", to apply in parallel transactions that group-committed together on the master; "transactional", to optimistically try to apply all transactional DML in parallel; and "waiting" to extend "transactional" to even transactions that had to wait on the master.
+VARIABLE_TYPE	ENUM
+VARIABLE_COMMENT	Controls what transactions are applied in parallel when using --slave-parallel-threads. Possible values: "optimistic" tries to apply most transactional DML in parallel, and handles any conflicts with rollback and retry. "conservative" limits parallelism in an effort to avoid any conflicts. "aggressive" tries to maximise the parallelism, possibly at the cost of increased conflict rate. "minimal" only parallelizes the commit steps of transactions. "none" disables parallel apply completely.
 NUMERIC_MIN_VALUE	NULL
 NUMERIC_MAX_VALUE	NULL
 NUMERIC_BLOCK_SIZE	NULL
-ENUM_VALUE_LIST	domain,follow_master_commit,transactional,waiting
+ENUM_VALUE_LIST	none,minimal,conservative,optimistic,aggressive
 READ_ONLY	NO
 COMMAND_LINE_ARGUMENT	NULL
 VARIABLE_NAME	SLAVE_PARALLEL_THREADS
diff --git a/mysql-test/suite/sys_vars/t/replicate_allow_parallel_basic.test b/mysql-test/suite/sys_vars/t/replicate_allow_parallel_basic.test
deleted file mode 100644
index 46dcbc7..0000000
--- a/mysql-test/suite/sys_vars/t/replicate_allow_parallel_basic.test
+++ /dev/null
@@ -1,14 +0,0 @@
---source include/not_embedded.inc
-
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SELECT @@global.replicate_allow_parallel;
-
---error ER_LOCAL_VARIABLE
-SET GLOBAL replicate_allow_parallel= 1;
-SELECT @@session.replicate_allow_parallel;
-SET SESSION replicate_allow_parallel= 0;
-SELECT @@session.replicate_allow_parallel;
-SET SESSION replicate_allow_parallel= 1;
-SELECT @@session.replicate_allow_parallel;
-
-# More testing of the actual functionality in rpl.rpl_parallel_* tests.
diff --git a/mysql-test/suite/sys_vars/t/skip_parallel_replication_basic.test b/mysql-test/suite/sys_vars/t/skip_parallel_replication_basic.test
new file mode 100644
index 0000000..3ccac55
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/skip_parallel_replication_basic.test
@@ -0,0 +1,14 @@
+--source include/not_embedded.inc
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@global.skip_parallel_replication;
+
+--error ER_LOCAL_VARIABLE
+SET GLOBAL skip_parallel_replication= 0;
+SELECT @@session.skip_parallel_replication;
+SET SESSION skip_parallel_replication= 1;
+SELECT @@session.skip_parallel_replication;
+SET SESSION skip_parallel_replication= 0;
+SELECT @@session.skip_parallel_replication;
+
+# More testing of the actual functionality in rpl.rpl_parallel_* tests.
diff --git a/mysql-test/suite/sys_vars/t/slave_parallel_mode_basic-master.opt b/mysql-test/suite/sys_vars/t/slave_parallel_mode_basic-master.opt
index cc40fa4..cd2ccb7 100644
--- a/mysql-test/suite/sys_vars/t/slave_parallel_mode_basic-master.opt
+++ b/mysql-test/suite/sys_vars/t/slave_parallel_mode_basic-master.opt
@@ -1 +1 @@
---slave-parallel-mode=domain --m1.slave-parallel-mode=transactional --m2.slave-parallel-mode=domain,follow_master_commit,waiting
+--slave-parallel-mode=minimal --m1.slave-parallel-mode=optimistic --m2.slave-parallel-mode=aggressive
diff --git a/mysql-test/suite/sys_vars/t/slave_parallel_mode_basic.test b/mysql-test/suite/sys_vars/t/slave_parallel_mode_basic.test
index 6e82345..4d233b1 100644
--- a/mysql-test/suite/sys_vars/t/slave_parallel_mode_basic.test
+++ b/mysql-test/suite/sys_vars/t/slave_parallel_mode_basic.test
@@ -3,7 +3,7 @@
 # Also tests some command line options, in slave_parallel_mode_basic-master.opt
 
 --error ER_GLOBAL_VARIABLE
-SET SESSION slave_parallel_mode= '';
+SET SESSION slave_parallel_mode= none;
 
 SELECT @@slave_parallel_mode;
 SELECT @@m1.slave_parallel_mode;
@@ -15,16 +15,16 @@ SELECT @@slave_parallel_mode;
 --source include/show_slave_status.inc
 
 SELECT @@m2.slave_parallel_mode;
-SET GLOBAL m2.slave_parallel_mode = '';
+SET GLOBAL m2.slave_parallel_mode = none;
 
 CHANGE MASTER 'm1' TO master_host='127.0.0.1', master_port=3311, master_user='root';
 SELECT @@m1.slave_parallel_mode;
 --source include/show_slave_status.inc
-SET GLOBAL m1.slave_parallel_mode= follow_master_commit;
+SET GLOBAL m1.slave_parallel_mode= conservative;
 --source include/show_slave_status.inc
 SET default_master_connection= 'm1';
 SELECT @@slave_parallel_mode;
-SET GLOBAL slave_parallel_mode= waiting;
+SET GLOBAL slave_parallel_mode= aggressive;
 SELECT @@slave_parallel_mode;
 --source include/show_slave_status.inc
 SET default_master_connection= '';
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 9bf9da8..4a7b1e2 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -6400,7 +6400,7 @@ bool Binlog_checkpoint_log_event::write(IO_CACHE *file)
     flags2|= FL_DDL;
   else if (is_transactional)
     flags2|= FL_TRANSACTIONAL;
-  if (thd_arg->variables.option_bits & OPTION_RPL_ALLOW_PARALLEL)
+  if (!(thd_arg->variables.option_bits & OPTION_RPL_SKIP_PARALLEL))
     flags2|= FL_ALLOW_PARALLEL;
   /* Preserve any DDL or WAITED flag in the slave's binlog. */
   if (thd_arg->rgi_slave)
@@ -6545,9 +6545,9 @@ bool Binlog_checkpoint_log_event::write(IO_CACHE *file)
   /* Execute this like a BEGIN query event. */
   bits|= OPTION_GTID_BEGIN;
   if (flags2 & FL_ALLOW_PARALLEL)
-    bits|= (ulonglong)OPTION_RPL_ALLOW_PARALLEL;
+    bits&= ~(ulonglong)OPTION_RPL_SKIP_PARALLEL;
   else
-    bits&= ~(ulonglong)OPTION_RPL_ALLOW_PARALLEL;
+    bits|= (ulonglong)OPTION_RPL_SKIP_PARALLEL;
   thd->variables.option_bits= bits;
   DBUG_PRINT("info", ("Set OPTION_GTID_BEGIN"));
   thd->set_query_and_id(gtid_begin_string, sizeof(gtid_begin_string)-1,
@@ -6638,8 +6638,8 @@ bool Binlog_checkpoint_log_event::write(IO_CACHE *file)
         print_event_info->allow_parallel != !!(flags2 & FL_ALLOW_PARALLEL))
     {
       my_b_printf(&cache,
-                  "/*!100101 SET @@session.replicate_allow_parallel=%u*/%s\n",
-                  !!(flags2 & FL_ALLOW_PARALLEL), print_event_info->delimiter);
+                  "/*!100101 SET @@session.skip_parallel_replication=%u*/%s\n",
+                  !(flags2 & FL_ALLOW_PARALLEL), print_event_info->delimiter);
       print_event_info->allow_parallel= !!(flags2 & FL_ALLOW_PARALLEL);
       print_event_info->allow_parallel_printed= true;
     }
diff --git a/sql/log_event.h b/sql/log_event.h
index 1cc75e0..b57ef35 100644
--- a/sql/log_event.h
+++ b/sql/log_event.h
@@ -3177,8 +3177,8 @@ class Gtid_log_event: public Log_event
   */
   static const uchar FL_TRANSACTIONAL= 4;
   /*
-    FL_ALLOW_PARALLEL reflects the value of @@SESSION.replicate_allow_parallel
-    at the time of commit.
+    FL_ALLOW_PARALLEL reflects the (negation of the) value of
+    @@SESSION.skip_parallel_replication at the time of commit.
   */
   static const uchar FL_ALLOW_PARALLEL= 8;
   /*
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 423d07b..ff4c40e 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -562,8 +562,7 @@ inline void setup_fpu()
 
 ulong opt_slave_parallel_threads= 0;
 ulong opt_slave_domain_parallel_threads= 0;
-ulonglong opt_slave_parallel_mode=
-  SLAVE_PARALLEL_DOMAIN | SLAVE_PARALLEL_FOLLOW_MASTER_COMMIT;
+ulonglong opt_slave_parallel_mode= SLAVE_PARALLEL_CONSERVATIVE;
 ulong opt_binlog_commit_wait_count= 0;
 ulong opt_binlog_commit_wait_usec= 0;
 ulong opt_slave_parallel_max_queued= 131072;
@@ -7326,16 +7325,16 @@ struct my_option my_long_options[]=
 #ifdef HAVE_REPLICATION
   {"slave-parallel-mode", OPT_SLAVE_PARALLEL_MODE,
    "Controls what transactions are applied in parallel when using "
-   "--slave-parallel-threads. Syntax: slave_parallel_mode=value[,value...], "
-   "where \"value\" could be one or more of: \"domain\", to apply different "
-   "replication domains in parallel; \"follow_master_commit\", to apply "
-   "in parallel transactions that group-committed together on the master; "
-   "\"transactional\", to optimistically try to apply all transactional "
-   "DML in parallel; and \"waiting\" to extend \"transactional\" to "
-   "even transactions that had to wait on the master.",
+   "--slave-parallel-threads. Possible values: \"optimistic\" tries to "
+   "apply most transactional DML in parallel, and handles any conflicts "
+   "with rollback and retry. \"conservative\" limits parallelism in an "
+   "effort to avoid any conflicts. \"aggressive\" tries to maximise the "
+   "parallelism, possibly at the cost of increased conflict rate. "
+   "\"minimal\" only parallelizes the commit steps of transactions. "
+   "\"none\" disables parallel apply completely.",
    &opt_slave_parallel_mode, &opt_slave_parallel_mode,
-   &slave_parallel_mode_typelib, GET_SET | GET_ASK_ADDR, REQUIRED_ARG,
-   SLAVE_PARALLEL_DOMAIN | SLAVE_PARALLEL_FOLLOW_MASTER_COMMIT, 0, 0, 0, 0, 0},
+   &slave_parallel_mode_typelib, GET_ENUM | GET_ASK_ADDR, REQUIRED_ARG,
+   SLAVE_PARALLEL_CONSERVATIVE, 0, 0, 0, 0, 0},
 #endif
 #if defined(_WIN32) && !defined(EMBEDDED_LIBRARY)
   {"slow-start-timeout", 0,
@@ -8847,7 +8846,8 @@ static int mysql_init_variables(void)
   case (int)OPT_SLAVE_PARALLEL_MODE:
   {
     /* Store latest mode for Master::Info */
-    cur_rpl_filter->set_parallel_mode(opt_slave_parallel_mode);
+    cur_rpl_filter->set_parallel_mode
+      ((enum_slave_parallel_mode)opt_slave_parallel_mode);
     break;
   }
 
diff --git a/sql/mysqld.h b/sql/mysqld.h
index f89f2e9..2db9db3 100644
--- a/sql/mysqld.h
+++ b/sql/mysqld.h
@@ -61,14 +61,16 @@
 #define OPT_GLOBAL SHOW_OPT_GLOBAL
 
 /*
-  Bit masks for the values in --slave-parallel-mode.
-  Note that these values cannot be changed - they are stored in master.info,
-  so need to be possible to read back in a different version of the server.
+  Values for --slave-parallel-mode
+  Must match order in slave_parallel_mode_typelib in sys_vars.cc.
 */
-#define SLAVE_PARALLEL_DOMAIN               (1ULL << 0)
-#define SLAVE_PARALLEL_FOLLOW_MASTER_COMMIT (1ULL << 1)
-#define SLAVE_PARALLEL_TRX                  (1ULL << 2)
-#define SLAVE_PARALLEL_WAITING              (1ULL << 3)
+enum enum_slave_parallel_mode {
+  SLAVE_PARALLEL_NONE,
+  SLAVE_PARALLEL_MINIMAL,
+  SLAVE_PARALLEL_CONSERVATIVE,
+  SLAVE_PARALLEL_OPTIMISTIC,
+  SLAVE_PARALLEL_AGGRESSIVE
+};
 
 /* Function prototypes */
 void kill_mysql(void);
diff --git a/sql/rpl_filter.cc b/sql/rpl_filter.cc
index e3ebd32..f1c6d76 100644
--- a/sql/rpl_filter.cc
+++ b/sql/rpl_filter.cc
@@ -24,7 +24,7 @@
 #define TABLE_RULE_ARR_SIZE   16
 
 Rpl_filter::Rpl_filter() : 
-  parallel_mode(SLAVE_PARALLEL_DOMAIN | SLAVE_PARALLEL_FOLLOW_MASTER_COMMIT),
+  parallel_mode(SLAVE_PARALLEL_CONSERVATIVE),
   table_rules_on(0),
   do_table_inited(0), ignore_table_inited(0),
   wild_do_table_inited(0), wild_ignore_table_inited(0)
diff --git a/sql/rpl_filter.h b/sql/rpl_filter.h
index f08971a..f24ece3 100644
--- a/sql/rpl_filter.h
+++ b/sql/rpl_filter.h
@@ -17,6 +17,7 @@
 #define RPL_FILTER_H
 
 #include "mysql.h"
+#include "mysqld.h"
 #include "sql_list.h"                           /* I_List */
 #include "hash.h"                               /* HASH */
 
@@ -76,12 +77,12 @@ class Rpl_filter
   int set_do_db(const char* db_spec);
   int set_ignore_db(const char* db_spec);
 
-  void set_parallel_mode(ulonglong mode)
+  void set_parallel_mode(enum_slave_parallel_mode mode)
   {
     parallel_mode= mode;
   }
   /* Return given parallel mode or if one is not given, the default mode */
-  int get_parallel_mode()
+  enum_slave_parallel_mode get_parallel_mode()
   {
     return parallel_mode;
   }
@@ -137,7 +138,7 @@ class Rpl_filter
   HASH ignore_table;
   DYNAMIC_ARRAY wild_do_table;
   DYNAMIC_ARRAY wild_ignore_table;
-  ulonglong parallel_mode;
+  enum_slave_parallel_mode parallel_mode;
 
   bool table_rules_on;
   bool do_table_inited;
diff --git a/sql/rpl_mi.h b/sql/rpl_mi.h
index 87ac0a5..b74b9cb 100644
--- a/sql/rpl_mi.h
+++ b/sql/rpl_mi.h
@@ -184,7 +184,8 @@ class Master_info : public Slave_reporting_capability
   static const char *using_gtid_astext(enum enum_using_gtid arg);
   bool using_parallel()
   {
-    return opt_slave_parallel_threads > 0 && parallel_mode != 0;
+    return opt_slave_parallel_threads > 0 &&
+      parallel_mode > SLAVE_PARALLEL_NONE;
   }
 
   /* the variables below are needed because we can change masters on the fly */
@@ -300,12 +301,8 @@ class Master_info : public Slave_reporting_capability
   /* domain-id based filter */
   Domain_id_filter domain_id_filter;
 
-  /*
-    The parallel replication modes, if any. A combination (binary OR) of any
-    of SLAVE_PARALLEL_DOMAIN, SLAVE_PARALLEL_FOLLOW_MASTER_COMMIT,
-    SLAVE_PARALLEL_TRX, and SLAVE_PARALLEL_WAITING.
-  */
-  ulonglong parallel_mode;
+  /* The parallel replication mode. */
+  enum_slave_parallel_mode parallel_mode;
 };
 
 int init_master_info(Master_info* mi, const char* master_info_fname,
diff --git a/sql/rpl_parallel.cc b/sql/rpl_parallel.cc
index 55cc699..39ed40a 100644
--- a/sql/rpl_parallel.cc
+++ b/sql/rpl_parallel.cc
@@ -2008,7 +2008,7 @@ struct rpl_parallel_thread *
   {
     Gtid_log_event *gtid_ev= static_cast<Gtid_log_event *>(ev);
     uint32 domain_id= (rli->mi->using_gtid == Master_info::USE_GTID_NO ||
-                       !(rli->mi->parallel_mode & SLAVE_PARALLEL_DOMAIN) ?
+                       rli->mi->parallel_mode <= SLAVE_PARALLEL_MINIMAL ?
                        0 : gtid_ev->domain_id);
     if (!(e= find(domain_id)))
     {
@@ -2049,7 +2049,7 @@ struct rpl_parallel_thread *
   {
     Gtid_log_event *gtid_ev= static_cast<Gtid_log_event *>(ev);
     bool new_gco;
-    ulonglong mode= rli->mi->parallel_mode;
+    enum_slave_parallel_mode mode= rli->mi->parallel_mode;
     uchar gtid_flags= gtid_ev->flags2;
     group_commit_orderer *gco;
     uint8 force_switch_flag;
@@ -2088,7 +2088,8 @@ struct rpl_parallel_thread *
     {
       uint8 flags= gco->flags;
 
-      if (!(gtid_flags & Gtid_log_event::FL_GROUP_COMMIT_ID) ||
+      if (mode <= SLAVE_PARALLEL_MINIMAL ||
+          !(gtid_flags & Gtid_log_event::FL_GROUP_COMMIT_ID) ||
           e->last_commit_id != gtid_ev->commit_id)
         flags|= group_commit_orderer::MULTI_BATCH;
       /* Make sure we do not attempt to run DDL in parallel speculatively. */
@@ -2103,7 +2104,7 @@ struct rpl_parallel_thread *
         */
         new_gco= false;
       }
-      else if ((mode & SLAVE_PARALLEL_TRX) &&
+      else if ((mode >= SLAVE_PARALLEL_OPTIMISTIC) &&
                !(flags & group_commit_orderer::FORCE_SWITCH))
       {
         /*
@@ -2119,9 +2120,9 @@ struct rpl_parallel_thread *
         */
         new_gco= false;
         if (!(gtid_flags & Gtid_log_event::FL_TRANSACTIONAL) ||
-            !(gtid_flags & Gtid_log_event::FL_ALLOW_PARALLEL) ||
-            ((gtid_flags & Gtid_log_event::FL_WAITED) &&
-             !(mode & SLAVE_PARALLEL_WAITING)))
+            ( (!(gtid_flags & Gtid_log_event::FL_ALLOW_PARALLEL) ||
+               (gtid_flags & Gtid_log_event::FL_WAITED)) &&
+              (mode < SLAVE_PARALLEL_AGGRESSIVE)))
         {
           /*
             This transaction should not be speculatively run in parallel with
diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt
index a5d3ba1..381370e 100644
--- a/sql/share/errmsg-utf8.txt
+++ b/sql/share/errmsg-utf8.txt
@@ -7115,8 +7115,8 @@ ER_SUBQUERIES_NOT_SUPPORTED 42000
         eng "%s does not support subqueries or stored functions."
 ER_SET_STATEMENT_NOT_SUPPORTED 42000
         eng "The system variable %.200s cannot be set in SET STATEMENT." 
-ER_INVALID_SLAVE_PARALLEL_MODE
-	eng "Invalid use of '%s' option for slave_parallel_mode"
+ER_UNUSED_17
+        eng "You should never see it"
 ER_USER_CREATE_EXISTS
         eng "Can't create user '%-.64s'@'%-.64s'; it already exists"
 ER_USER_DROP_EXISTS
diff --git a/sql/slave.cc b/sql/slave.cc
index f193659..6d64534 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -2585,7 +2585,7 @@ static bool send_show_master_info_header(THD *thd, bool full,
   field_list.push_back(new Item_empty_string("Replicate_Ignore_Domain_Ids",
                                              FN_REFLEN));
   field_list.push_back(new Item_empty_string("Parallel_Mode",
-             sizeof("domain,follow_master_commit,transactional,waiting")-1));
+                                             sizeof("conservative")-1));
   if (full)
   {
     field_list.push_back(new Item_return_int("Retried_transactions",
@@ -2788,22 +2788,9 @@ static bool send_show_master_info_data(THD *thd, Master_info *mi, bool full,
 
     // Parallel_Mode
     {
-      /* Note how sizeof("domain") has room for "domain," due to traling 0. */
-      char buf[sizeof("domain") + sizeof("follow_master_commit") +
-               sizeof("transactional") + sizeof("waiting") + 1];
-      char *p= buf;
-      uint32 mode= mi->parallel_mode;
-      if (mode & SLAVE_PARALLEL_DOMAIN)
-        p= strmov(p, "domain,");
-      if (mode & SLAVE_PARALLEL_FOLLOW_MASTER_COMMIT)
-        p= strmov(p, "follow_master_commit,");
-      if (mode & SLAVE_PARALLEL_TRX)
-        p= strmov(p, "transactional,");
-      if (mode & SLAVE_PARALLEL_WAITING)
-        p= strmov(p, "waiting,");
-      if (p != buf)
-        --p;                                    // Discard last ','
-      protocol->store(buf, p-buf, &my_charset_bin);
+      const char *mode_name= get_type(&slave_parallel_mode_typelib,
+                                      mi->parallel_mode);
+      protocol->store(mode_name, strlen(mode_name), &my_charset_bin);
     }
 
     if (full)
diff --git a/sql/sql_priv.h b/sql/sql_priv.h
index 1389065..7ba027d 100644
--- a/sql/sql_priv.h
+++ b/sql/sql_priv.h
@@ -181,7 +181,7 @@
 */
 #define OPTION_ALLOW_BATCH              (1ULL << 36) // THD, intern (slave)
 #define OPTION_SKIP_REPLICATION         (1ULL << 37) // THD, user
-#define OPTION_RPL_ALLOW_PARALLEL       (1ULL << 38)
+#define OPTION_RPL_SKIP_PARALLEL        (1ULL << 38)
 
 /* The rest of the file is included in the server only */
 #ifndef MYSQL_CLIENT
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index 26d4d7a..b535cec 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -1874,18 +1874,12 @@ static Sys_var_ulong Sys_slave_parallel_max_queued(
 bool
 Sys_var_slave_parallel_mode::global_update(THD *thd, set_var *var)
 {
-  ulonglong new_value= var->save_result.ulonglong_value;
+  enum_slave_parallel_mode new_value=
+    (enum_slave_parallel_mode)var->save_result.ulonglong_value;
   LEX_STRING *base_name= &var->base;
   Master_info *mi;
   bool res= false;
 
-  if ((new_value & (SLAVE_PARALLEL_FOLLOW_MASTER_COMMIT|SLAVE_PARALLEL_TRX)) ==
-      (SLAVE_PARALLEL_FOLLOW_MASTER_COMMIT|SLAVE_PARALLEL_TRX))
-  {
-    my_error(ER_INVALID_SLAVE_PARALLEL_MODE, MYF(0), "transactional");
-    return true;
-  }
-
   if (!base_name->length)
     base_name= &thd->variables.default_master_connection;
 
@@ -1928,7 +1922,8 @@ static Sys_var_ulong Sys_slave_parallel_max_queued(
                                               const LEX_STRING *base_name)
 {
   Master_info *mi;
-  ulonglong val= opt_slave_parallel_mode;
+  enum_slave_parallel_mode val=
+    (enum_slave_parallel_mode)opt_slave_parallel_mode;
 
   if (!base_name->length)
     base_name= &thd->variables.default_master_connection;
@@ -1947,13 +1942,14 @@ static Sys_var_ulong Sys_slave_parallel_max_queued(
   mysql_mutex_lock(&LOCK_global_system_variables);
   if (!mi)
     return 0;
-  
-  return (uchar*)set_to_string(thd, 0, val, typelib.type_names);
+
+  return valptr(thd, val);
 }
 
 
+/* The order here must match enum_slave_parallel_mode in mysqld.h. */
 static const char *slave_parallel_mode_names[] = {
-  "domain", "follow_master_commit", "transactional", "waiting", NULL
+  "none", "minimal", "conservative", "optimistic", "aggressive", NULL
 };
 export TYPELIB slave_parallel_mode_typelib = {
   array_elements(slave_parallel_mode_names)-1,
@@ -1965,28 +1961,26 @@ static Sys_var_ulong Sys_slave_parallel_max_queued(
 static Sys_var_slave_parallel_mode Sys_slave_parallel_mode(
        "slave_parallel_mode",
        "Controls what transactions are applied in parallel when using "
-       "--slave-parallel-threads. Syntax: slave_parallel_mode=value[,value...], "
-       "where \"value\" could be one or more of: \"domain\", to apply different "
-       "replication domains in parallel; \"follow_master_commit\", to apply "
-       "in parallel transactions that group-committed together on the master; "
-       "\"transactional\", to optimistically try to apply all transactional "
-       "DML in parallel; and \"waiting\" to extend \"transactional\" to "
-       "even transactions that had to wait on the master.",
-       GLOBAL_VAR(opt_slave_parallel_mode),
-       NO_CMD_LINE, slave_parallel_mode_names,
-       DEFAULT(SLAVE_PARALLEL_DOMAIN |
-               SLAVE_PARALLEL_FOLLOW_MASTER_COMMIT));
-
-
-static Sys_var_bit Sys_replicate_allow_parallel(
-       "replicate_allow_parallel",
-       "If set when a transaction is written to the binlog, that transaction "
-       "is allowed to replicate in parallel on a slave where "
-       "slave_parallel_mode is set to \"transactional\". Can be cleared for "
-       "transactions that are likely to cause a conflict if replicated in "
-       "parallel, to avoid unnecessary rollback and retry.",
-       SESSION_ONLY(option_bits), NO_CMD_LINE, OPTION_RPL_ALLOW_PARALLEL,
-       DEFAULT(TRUE), NO_MUTEX_GUARD, NOT_IN_BINLOG);
+       "--slave-parallel-threads. Possible values: \"optimistic\" tries to "
+       "apply most transactional DML in parallel, and handles any conflicts "
+       "with rollback and retry. \"conservative\" limits parallelism in an "
+       "effort to avoid any conflicts. \"aggressive\" tries to maximise the "
+       "parallelism, possibly at the cost of increased conflict rate. "
+       "\"minimal\" only parallelizes the commit steps of transactions. "
+       "\"none\" disables parallel apply completely.",
+       GLOBAL_VAR(opt_slave_parallel_mode), NO_CMD_LINE,
+       slave_parallel_mode_names, DEFAULT(SLAVE_PARALLEL_CONSERVATIVE));
+
+
+static Sys_var_bit Sys_skip_parallel_replication(
+       "skip_parallel_replication",
+       "If set when a transaction is written to the binlog, parallel apply of "
+       "that transaction will be avoided on a slave where slave_parallel_mode "
+       "is not \"aggressive\". Can be used to avoid unnecessary rollback and "
+       "retry for transactions that are likely to cause a conflict if "
+       "replicated in parallel.",
+       SESSION_ONLY(option_bits), NO_CMD_LINE, OPTION_RPL_SKIP_PARALLEL,
+       DEFAULT(FALSE), NO_MUTEX_GUARD, NOT_IN_BINLOG);
 
 
 static bool
diff --git a/sql/sys_vars.h b/sql/sys_vars.h
index 6ec051d..6d500e1 100644
--- a/sql/sys_vars.h
+++ b/sql/sys_vars.h
@@ -2281,14 +2281,15 @@ class Sys_var_last_gtid: public sys_var
 /**
    Class for connection_name.slave_parallel_mode.
 */
-class Sys_var_slave_parallel_mode: public Sys_var_set
+class Sys_var_slave_parallel_mode: public Sys_var_enum
 {
 public:
   Sys_var_slave_parallel_mode(const char *name_arg,
           const char *comment, int flag_args, ptrdiff_t off, size_t size,
-          CMD_LINE getopt, const char *values[], ulonglong def_val)
-    : Sys_var_set(name_arg, comment, flag_args, off, size,
-                  getopt, values, def_val)
+          CMD_LINE getopt, const char *values[],
+          enum_slave_parallel_mode def_val)
+    : Sys_var_enum(name_arg, comment, flag_args, off, size,
+                   getopt, values, def_val)
   {
     option.var_type|= GET_ASK_ADDR;
     option.value= (uchar**)1; // crash me, please


More information about the commits mailing list