[MDEV-20608] innodb_log_optimize_ddl=OFF may omit some redo log Created: 2019-09-17 Updated: 2023-04-27 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | mariabackup, Storage Engine - InnoDB |
| Affects Version/s: | 10.2.17, 10.3.9, 10.4.0 |
| Fix Version/s: | 10.4 |
| Type: | Bug | Priority: | Major |
| Reporter: | Marko Mäkelä | Assignee: | Marko Mäkelä |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | backup | ||
| Issue Links: |
|
||||||||||||||||
| Description |
|
Unfortunately, while the PageBulk code appears to write redo log for many operations, both in PageBulk::insert() and PageBulk::finish(), the modifications of the sparse page directory and the linked list of records are not being redo-logged. Furthermore, PageBulk::init() is bypassing some checks by setting a flag buf_block_t::skip_flush_check, which should not exist at all. There should be no special logic for flushing ‘incomplete’ pages, and all changes to persistent pages should be redo-logged if innodb_log_optimize_ddl=OFF. As far as I can tell, there should be no impact on InnoDB crash recovery due to this. The omitted redo logging should only affect scenarios where mariabackup --backup is run concurrently with a table-rebuilding or index-creating ALTER TABLE…ALGORITHM=INPLACE operation. |
| Comments |
| Comment by Marko Mäkelä [ 2019-09-17 ] | ||
|
The implementation of the new physical-only redo log record format in | ||
| Comment by Marko Mäkelä [ 2019-09-17 ] | ||
|
It seems that PageBulk::insert() is covered by MLOG_REC_INSERT or MLOG_COMP_REC_INSERT or MLOG_ZIP_PAGE_COMPRESS, after all. The only doubt could be around buf_block_t::skip_flush_check. | ||
| Comment by Marko Mäkelä [ 2019-09-17 ] | ||
|
Note: PageBulk::finish() is writing redo log for some operations but not all of them. Apparently, the low-level operations in PageBulk::insert() must not be redo-logged, because that would lead to failure when applying MLOG_REC_INSERT or MLOG_COMP_REC_INSERT records. I should have more information soon, after I have successfully replaced the MLOG_REC_DELETE and MLOG_REC_INSERT records in the | ||
| Comment by Marko Mäkelä [ 2019-09-19 ] | ||
|
Even after successfully replacing the MLOG_REC_INSERT and MLOG_COMP_REC_INSERT records in my
while concurrently running the backup, and then executing CHECK TABLE on the copy from mariabackup --restore could do the trick. Again, this should affect innodb_log_optimize_ddl=OFF only, and probably not ROW_FORMAT=COMPRESSED tables. |