[MDEV-15372] Parallel slave speedup very limited when log_slave_updates=OFF Created: 2018-02-21 Updated: 2019-03-28 Resolved: 2018-02-22 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - RocksDB |
| Affects Version/s: | 10.2 |
| Fix Version/s: | 10.2.14 |
| Type: | Bug | Priority: | Major |
| Reporter: | Sergei Petrunia | Assignee: | Sergei Petrunia |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
||||||||||||
| Issue Links: |
|
||||||||||||
| Description |
|
Branching this off from Parallel slave (slave_parallel_mode=conservative does not provide a lot of speedup over single-threaded slave when log_slave_updates=OFF. When log_slave_updates=ON the performance is acceptable. Summary of the investigations from The reason is that with log_slave_updates=ON the server employs XA between the storage engine the binlog:
With log_slave_updates=OFF :
|
| Comments |
| Comment by Sergei Petrunia [ 2018-02-21 ] | |||||||||||||||||||||||||
|
With InnoDB, the issue doesn't exist. This seems to be because innobase_commit() has two parts: The first one is run sequentially:
then it informs the SQL layer that the rest can be done in parallel:
and the slower part is done in parallel:
| |||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2018-02-21 ] | |||||||||||||||||||||||||
|
A similar patch for MyRocks:
| |||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2018-02-21 ] | |||||||||||||||||||||||||
|
An alternative suggestion is to have the slave to not flush. Master's binlog is always available, so if we crash and lose some transaction, we will know that from mysql.gtid_slave_pos table, and will replay. This seems risky and might not work in all cases, e.g. we will need to flush when semi-sync plugin is used? | |||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2018-02-21 ] | |||||||||||||||||||||||||
|
Let's denote the above patch as "parallel flush". I've re-used the benchmark script from
| |||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2019-03-28 ] | |||||||||||||||||||||||||
|
The fix for this issue causes poor performance for non-slave, see MDEV-18080. |