Details
-
New Feature
-
Status: Needs Feedback (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
Description
SAMU-64 Allow administrators to enable or disable parallel replication on a per-table basis
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 behavior 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.
Attachments
Issue Links
- mentioned in
-
Page Failed to load
-
Page Failed to load
-
Page Failed to load
-
Page Failed to load
-
Page Failed to load
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
- relates to
-
SAMU-64 Loading...
ElkinFollowing-up on my last post, the added complexity of expanding this via GTID domain ID could be a little rough.
The default assumption of different GTID domains is that they exist for when multiple datasets that do not have interdependencies of any kind with each other exist on the same MariaDB Server. This differs from what we're discussing in this MDEV.
For the original implementation, ignoring the above was fine because the end user does not use GTID domains, so it was safe for us to "abuse" GTID domain ID functionality to handle this because we know, intrinsically, that we still need to synchronize between that GTID domain and the main one.
However, for more generalized use-cases where end users have multiple GTID domains already in-use, there becomes the question of how to map things. Ex, say I have gtid_domain_id=1, gtid_domain_id=2, and gtid_domain_id=3 on my MariaDB Server 10.6. These are all unique replication streams which do not depend on each other at all and can run in complete parallel with each other.
Now say that I am ready to upgrade to a MariaDB version that supports something like this MDEV-30421. Say I have a table in gtid_domain_id=2 which runs afoul of slave_parallel_mode=optimistic, so I want to separate that table into a serial replication setup.
I think the real problem to solve is how we'd handle the above. Just creating gtid_domain_id=99 and configuring that table to use single-thread replication and for that to synchronize with gtid_domain_id=2 might be a little difficult.
It may be worth exploring other nomenclature pathways for this. Whether that would require adding to GTID (ex- domain_id-stream_id-server_id-position) or using server_id instead (maybe update the documentation on that to make it a little more abstract) as that might map a little closer to what we're doing logically here (though from a technical standpoint, that seems to have a lot of obstacles as well, not the least of which that it would raise some major questions about how to configure primaries and replicas such that when a primary fails, a replica can be promoted without needing its configuration changed extensively).
Is this more of what you were getting at Elkin?