summaryrefslogtreecommitdiff
path: root/sql/sql_class.h
diff options
context:
space:
mode:
authorAleksey Midenkov <midenok@gmail.com>2023-01-16 00:01:35 +0300
committerAleksey Midenkov <midenok@gmail.com>2023-03-26 20:20:42 +0300
commit06a7eb2dc31a273c3408ae983c3a2a7523dc353a (patch)
treefb3311b1d3c6727d564da35dd37b295793c8d841 /sql/sql_class.h
parent8f934a8a573dedf15b40d9cdb1d033e24792c70c (diff)
downloadmariadb-git-bb-11.0-midenok-MDEV-30421.tar.gz
MDEV-30421 Allow administrators to enable or disable parallel replication on a per-table basisbb-11.0-midenok-MDEV-30421
Per-domain dedicated thread for processing ordered transactions. The thread is reserved from the total number of domain threads (controlled by slave_parallel_threads and slave_domain_parallel_threads). Whether the event goes to ordered thread depends on FL_ALLOW_PARALLEL flag as well as several other conditions. FL_ALLOW_PARALLEL is passed from master and is set for the event depending on master configuration directives. To allow dedicated slave on server one must enable it explicitly with configuration directive: set global slave_ordered_thread= 1; Originally it was controlled by skip_parallel_replication session variable which can be changed per-statement. This patch adds several more directives to control it on per-schema and per-table levels: parallel_do_db parallel_do_table parallel_ignore_db parallel_ignore_table parallel_wild_do_table parallel_wild_ignore_table Each directive is comma-separated list of fully-qualified table names. Spaces after comma are ignored (but not before). "Table" directives take precedence over "db" directives. "Do" directives take precedence over "ignore" directives. "Wild" directives are checked if "do" and "ignore" directives did not match. If none of the above directives present everything is considered parallel. If any of the above directives present and the table did not match anything in the lists it is considered ordered. Examples: set @@global.parallel_do_db= "db_parallel"; set @@global.parallel_ignore_db= "db_serial"; set global parallel_do_table= "db_serial.t3, db_serial.t1"; set global parallel_wild_ignore_table= "db_parallel.non_parallel_%" Normal behaviour of ordered transaction is before start to wait any of prior transactions to commit: they get into different commit groups. But since all the ordered transactions (within one domain) go to a single thread we may avoid that restriction with this directive on slave: set global slave_ordered_dont_wait= 1; When set events without explicit FL_WAITED flag going to ordered thread nonetheless accept optimistic speculation. I.e. they get into same commit group with parallel events: ordered event is executed in parallel with parallel events.
Diffstat (limited to 'sql/sql_class.h')
-rw-r--r--sql/sql_class.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 79f347f40c5..1c2acc80057 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -2907,6 +2907,7 @@ public:
bool create_tmp_table_for_derived;
bool save_prep_leaf_list;
+ bool rpl_ordered;
/* container for handler's private per-connection data */
Ha_data ha_data[MAX_HA];