server
server copied to clipboard
MDEV-20065 parallel replication for galera slave
- [x] The Jira issue number for this PR is: MDEV-20065
Description
When replicating transactions from parallel slave replication processing, Galera must respect the commit order of the parallel slave replication. In the current implementation this is done by calling wait_for_prior_commit() before the write set is replicated and certified in before-prepare processing. This however establishes a critical section which is held over whole Galera replication step, and the commit rate will be limited by Galera replication latency.
In order to allow concurrency in Galera replication step, the critical section must be released at earliest point where Galera can guarantee sequential consistency for replicated write sets. This change passes a callback to release the critical section by calling wakeup_subsequent_commits() to Galera library, which will call the callback once the correct replication order can be established. This functionality will be available from Galera 26.4.22 onwards.
Note that call to wakeup_subsequent_commits() at this stage is safe from group commit point of view as Galera uses separate wait_for_commit context to control commit ordering.
How can this PR be tested?
This change is an optimization, and does not have associated MTR or unit tests.
In order to test, Start Galera Cluster and make one of the Galera nodes as a slave to MariaDB master server.
By varying slave_parallel_threads it should be observed that the transaction throughput increases when
more parallel slave threads are added. For this to work, slave_parallel_mode should be set to optimistic or
aggressive.
Basing the PR against the correct MariaDB version
- [x] This is a new feature or a refactoring, and the PR is based against the
mainbranch. - [ ] This is a bug fix, and the PR is based against the earliest maintained branch in which the bug can be reproduced.
PR quality check
- [x] I checked the CODING_STANDARDS.md file and my PR conforms to this where appropriate.
- [x] For any trivial modifications to the PR, I am ok with the reviewer making the changes themselves.