[Commits] Rev 4495: MDEV-6676: Speculative parallel replication: Intermediate commit. in http://bazaar.launchpad.net/~maria-captains/maria/10.0

knielsen at knielsen-hq.org knielsen at knielsen-hq.org
Thu Nov 13 16:07:14 EET 2014


At http://bazaar.launchpad.net/~maria-captains/maria/10.0

------------------------------------------------------------
revno: 4495
revision-id: knielsen at knielsen-hq.org-20140916080732-50roqwrx42aycshe
parent: knielsen at knielsen-hq.org-20140911103733-korw87s2rtah2uki
committer: Kristian Nielsen <knielsen at knielsen-hq.org>
branch nick: work-10.0-mdev6676
timestamp: Tue 2014-09-16 10:07:32 +0200
message:
  MDEV-6676: Speculative parallel replication: Intermediate commit.
  
  Adding the --slave-parallel-mode and @@SESSION.replicate_allow_parallel
  variables, not functional yet.
=== modified file 'mysql-test/r/mysqld--help.result'
--- a/mysql-test/r/mysqld--help.result	2014-08-07 16:06:56 +0000
+++ b/mysql-test/r/mysqld--help.result	2014-09-16 08:07:32 +0000
@@ -915,6 +915,17 @@
  parallel replication thread when reading ahead in the
  relay log looking for opportunities for parallel
  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_paralle_mode=value[,value...], where "value" could
+ be one or more of: "domain", to apply different
+ replication domains in parallel; "groupcommit", 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=# 
  If non-zero, number of threads to spawn to apply in
  parallel events on the slave that were group-committed on
@@ -1309,6 +1320,7 @@ slave-exec-mode STRICT
 slave-max-allowed-packet 1073741824
 slave-net-timeout 3600
 slave-parallel-max-queued 131072
+slave-parallel-mode domain,groupcommit,transactional
 slave-parallel-threads 0
 slave-skip-errors (No default value)
 slave-sql-verify-checksum TRUE

=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc	2014-11-13 08:56:28 +0000
+++ b/sql/mysqld.cc	2014-09-16 08:07:32 +0000
@@ -561,6 +561,8 @@ ulong stored_program_cache_size= 0;
 
 ulong opt_slave_parallel_threads= 0;
 ulong opt_slave_domain_parallel_threads= 0;
+ulonglong opt_slave_parallel_mode=
+  SLAVE_PARALLEL_DOMAIN | SLAVE_PARALLEL_GROUPCOMMIT | SLAVE_PARALLEL_TRX;
 ulong opt_binlog_commit_wait_count= 0;
 ulong opt_binlog_commit_wait_usec= 0;
 ulong opt_slave_parallel_max_queued= 131072;

=== modified file 'sql/mysqld.h'
--- a/sql/mysqld.h	2014-11-13 08:56:28 +0000
+++ b/sql/mysqld.h	2014-09-16 08:07:32 +0000
@@ -187,6 +187,7 @@ extern ulong stored_program_cache_size;
 extern ulong opt_slave_parallel_threads;
 extern ulong opt_slave_domain_parallel_threads;
 extern ulong opt_slave_parallel_max_queued;
+extern ulonglong opt_slave_parallel_mode;
 extern ulong opt_binlog_commit_wait_count;
 extern ulong opt_binlog_commit_wait_usec;
 extern my_bool opt_gtid_ignore_duplicates;

=== modified file 'sql/rpl_parallel.h'
--- a/sql/rpl_parallel.h	2014-11-13 09:20:48 +0000
+++ b/sql/rpl_parallel.h	2014-09-16 08:07:32 +0000
@@ -12,6 +12,13 @@ class Relay_log_info;
 struct inuse_relaylog;
 
 
+/* Bit masks for the values in --slave-parallel-mode. */
+#define SLAVE_PARALLEL_DOMAIN      (1ULL << 0)
+#define SLAVE_PARALLEL_GROUPCOMMIT (1ULL << 1)
+#define SLAVE_PARALLEL_TRX         (1ULL << 2)
+#define SLAVE_PARALLEL_WAITING     (1ULL << 3)
+
+
 /*
   Structure used to keep track of the parallel replication of a batch of
   event-groups that group-committed together on the master.

=== modified file 'sql/sql_priv.h'
--- a/sql/sql_priv.h	2014-10-09 08:30:11 +0000
+++ b/sql/sql_priv.h	2014-09-16 08:07:32 +0000
@@ -181,6 +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)
 
 /* The rest of the file is included in the server only */
 #ifndef MYSQL_CLIENT

=== modified file 'sql/sys_vars.cc'
--- a/sql/sys_vars.cc	2014-10-09 08:30:11 +0000
+++ b/sql/sys_vars.cc	2014-09-16 08:07:32 +0000
@@ -1834,6 +1834,38 @@ static Sys_var_ulong Sys_slave_parallel_
        VALID_RANGE(0,2147483647), DEFAULT(131072), BLOCK_SIZE(1));
 
 
+static const char *slave_parallel_mode_names[] = {
+  "domain", "groupcommit", "transactional", "waiting", NULL
+};
+
+static Sys_var_set Sys_slave_parallel_mode(
+       "slave_parallel_mode",
+       "Controls what transactions are applied in parallel when using "
+       "--slave-parallel-threads. Syntax: slave_paralle_mode=value[,value...], "
+       "where \"value\" could be one or more of: \"domain\", to apply "
+       "different replication domains in parallel; \"groupcommit\", 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), CMD_LINE(REQUIRED_ARG),
+       slave_parallel_mode_names,
+       DEFAULT(SLAVE_PARALLEL_DOMAIN |
+               SLAVE_PARALLEL_GROUPCOMMIT |
+               SLAVE_PARALLEL_TRX));
+
+
+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);
+
+
 static bool
 check_gtid_ignore_duplicates(sys_var *self, THD *thd, set_var *var)
 {



More information about the commits mailing list