[MDEV-19586] Replace recv_sys_t::addr_hash with a std::map Created: 2019-05-24 Updated: 2023-11-27 Resolved: 2019-06-11 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Fix Version/s: | 10.5.0 |
| Type: | Task | Priority: | Major |
| Reporter: | Marko Mäkelä | Assignee: | Marko Mäkelä |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | performance, recovery | ||
| Attachments: |
|
||||||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||||||
| Description |
|
The most straightforward way to achieve this would seem to be to replace the hash table with an ordered data structure, such as std::map, which would automatically be iterated in an ordered fashion. While we are at it, we should merge the |
| Comments |
| Comment by Marko Mäkelä [ 2019-05-31 ] | |||||||||||||||||||
|
kevg gave some valuable feedback:
Some more things remain to be done:
| |||||||||||||||||||
| Comment by Marko Mäkelä [ 2019-06-10 ] | |||||||||||||||||||
|
It turns out that some cleanup has to be deferred.
| |||||||||||||||||||
| Comment by Marko Mäkelä [ 2019-06-11 ] | |||||||||||||||||||
|
I evaluated the performance with the following simple benchmark:
To my surprise, recv_sys_t::add() turned out to become a bottleneck. It would spend a lot of time seeking to the end of the singly-linked list. Introducing the shortcut pointer recv_sys_t::recs_t::last fixed this bottleneck, and the performance became similar. I found the bottleneck by removing the line
(which would lead to the test failing), then backing up the data directory, and timing the recovery as follows:
The last (invalid) option will cause the server to shut down immediately after InnoDB startup. Finally, I would analyze the data with
This could be repeated as many times as needed, always restoring the data directory in between, so that on each execution, the exactly same redo log records will be processed. A larger recovery test on a bigger buffer pool, data set and possibly a hard disk would be needed to notice a significant performance difference. |