[MDEV-21725] Optimize btr_page_reorganize_low() redo logging Created: 2020-02-13  Updated: 2020-02-18

Status: Stalled
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: 10.5
Fix Version/s: 10.5

Type: Bug Priority: Major
Reporter: Marko Mäkelä Assignee: Marko Mäkelä
Resolution: Unresolved Votes: 1
Labels: performance

Issue Links:
Problem/Incident
is caused by MDEV-12353 Efficient InnoDB redo log record format Closed
Relates
relates to MDEV-21724 Optimize page_cur_insert_rec_low() re... Closed

 Description   

MDEV-12353 introduces a purely physical redo log format.

For btr_page_reorganize_low(), there is no optimization as of now. It is essentially copying the page payload to the redo log, as if all records were inserted anew. A better approach would be to compare the old page contents to the reorganized one, and only emit the minimal amount of WRITE or MEMMOVE records to cover the changes.

This affects especially the innodb_defragment feature, because it is invoking btr_page_reorganize_low() extensively. The test used to work with the mysql-test/include/default_mysqld.cnf se{{page_delete_rec_list_end()}}tting of innodb_log_buffer_size=1M, but that had to be increased to innodb_log_buffer_size=6M to avoid warnings about the buffer being extended.



 Comments   
Comment by Marko Mäkelä [ 2020-02-14 ]

Related to this, page_delete_rec_list_end() and page_cur_delete_rec() should be rewritten so that they will decrement PAGE_HEAP_TOP when deleting the very last records of a page, instead of prepending the deleted record to the PAGE_FREE list. That should reduce the need of page reorganize operations.

It could be worthwhile to always reorganize the page as part of page_delete_rec_list_start() and page_delete_rec_list_end().

Comment by Marko Mäkelä [ 2020-02-18 ]

I pushed an initial fix that will still copy the entire changed page payload area to the redo log. A complete fix should make use of MEMMOVE records to minimize the redo log volume.

Generated at Thu Feb 08 09:09:20 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.