[MDEV-24676] Concurrent multi-reader, multi-writer buffer for IO_CACHE Created: 2021-01-25 Updated: 2023-08-15 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Replication |
| Fix Version/s: | None |
| Type: | Task | Priority: | Minor |
| Reporter: | Nikita Malyavin | Assignee: | Nikita Malyavin |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | gsoc21 | ||
| Issue Links: |
|
||||||||
| Description |
| Comments |
| Comment by Rupeekshan Maheswaran [ 2021-01-30 ] |
|
Hi, I'm Rupeekshan Maheswaran, currently pursuing B.Sc Honours degree in Computer Science at the University of Jaffna, Sri Lanka. I'm particularly interested in this issue to complete as my GSoC 2021 project. I would like to request guidance regarding this issue.Thanks. |
| Comment by Nikita Malyavin [ 2021-01-31 ] |
|
Hello, Rupeekshan! Sorry to tell you, but this task is already taken by Vladislav Kakurin, another B.Sc student |
| Comment by Rupeekshan Maheswaran [ 2021-01-31 ] |
|
Thank you so much for the response! |
| Comment by Nikita Malyavin [ 2021-08-30 ] |
|
So far, the 2021 GSoC is finished. We have reached the Fine grained Single-reader, Multiple-writers milestone. Multiple-readers is still in TODO. One important design flaw has been found by Vladislav: we cannot acquire the _buffer_lock on _slot_release(), while holding flush_rw_lock. Suchwise, flush_rw_lock should be released before acquiring _buffer_lock. With this change, two problems pop up: 1. When the buffer is full, and flush is happened, the buffer is invalidated and new data can be written in the addresses overlapping with the slots not yet released. This problem should be carefully worked out: most probably by introducing buffer versions increasing after each flush, or more careful helping in this case, if possible (like, checking for own slot's finished, which will mean we can help for the next version's slots). 2. locking _buffer_lock in _slot_release() may result in waiting for the flush end. This should be also handled somehow. For example, by unlocking _buffer_lock earlier by the flusher. Further optimizations can be made, as seen now:
The API is minimalistic yet. We should at least add size() and ability to contigiously (atomically) write from some reentrant source (generator in Python terms), like another file, to make the solution work for us |