[MDEV-21923] Write redo log concurrently without lock Created: 2020-03-12 Updated: 2020-03-12 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major |
| Reporter: | peng | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | innodb | ||
| Issue Links: |
|
||||||||||||||||
| Description |
|
MySQL #WL10310 optimizes the redo log(unlock and write concurrently). Does MariaDB plan to optimize redo log? |
| Comments |
| Comment by Marko Mäkelä [ 2020-03-12 ] |
|
I am not convinced that a lock-free algorithm is always better than one that uses mutexes. It could lead to lots of busy work (wasted CPU cycles in polling loops). In
|
| Comment by peng [ 2020-03-12 ] |
|
How much performance improvement is expected by MDEV-14425? |
| Comment by Vladislav Vaintroub [ 2020-03-12 ] |
|
I think reducing pressure on log_sys.mutex would be fine, and parallel copy to redo log buffer is not a bad thing. I do not think this is particularly hard, but you need to wait for all copies to complete prior to writing to the disk. my first guess, it could be done with just a single atomic counter. |
| Comment by Marko Mäkelä [ 2020-03-12 ] |
|
The durability of a mini-transaction would only be guaranteed when there are no ‘gaps’ in the stream. Say, if the log for mini-transactions 101,102,103,104,105 is ‘in flight’, but a part of the log segment that was reserved for mini-transaction 102 was not written to durable storage before the server was killed, then we could only recover everything up to the end of mini-transaction 101. Implementing the For higher-latency storage, such as hard disks or SSD, supporting multiple concurrent writers could be beneficial even when using a more flexible file format. There are some noteworthy ideas in the MySQL 8.0 design, but I would prefer fewer ‘coordinator’ or ‘maintenance’ threads and generally something event-based instead of polling or timeouts. |
| Comment by Vladislav Vaintroub [ 2020-03-12 ] |
|
well, finding gaps is something that both recovery , and log_write_up_to() should take care of. |
| Comment by Vladislav Vaintroub [ 2020-03-12 ] |
|
As or the MySQL 8.0 design, yes, multiplying threads that only do 1 thing, and threads that only wake ups other threads, and threads and so on is much, much too involved. I think for parallel memcpy to the redo log buffer, no extra threads are necessary I think one can do fine with (at most 1) background task if we want less wait latency (e.g if log_write_up to would start async task to flush the redo buffer , and the current foreground user thread would check is his lsn completed later, just prior to writing network packet). This can even be improved upon for the threadpool, where foreground thread would not have to wait at all , but instead take over work from other users,. |