[MDEV-17138] Reduce redo log volume for undo tablespace initialization Created: 2018-09-05  Updated: 2019-11-13  Resolved: 2018-09-11

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: 10.2, 10.3, 10.4
Fix Version/s: 10.4.0

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

Issue Links:
Relates
relates to MDEV-14909 MariaDB 10.2 refuses to start up afte... Closed
relates to MDEV-13564 TRUNCATE TABLE and undo tablespace tr... Closed
relates to MDEV-14425 Change the InnoDB redo log format to ... Closed

 Description   

The function trx_rseg_header_create() is emitting a large amount of low-level redo log records for initializing an array of data to FIL_NULL (0xff bytes). In MDEV-13564, the mini-transaction log size for initializing an undo tablespace exceeds 1 megabyte, triggering some warnings and requiring a slightly bigger buffer pool size to avoid a hang during crash recovery.

We should introduce higher-level redo log record types for initializing undo log tablespaces. Ultimately, related to MDEV-14425 we should introduce a redo log format that only encodes a page number at most once per mini-transaction, instead of encoding it for every single operation. The introduction of redo log record types will require updating the redo log format tag, and thus prevent a crash-downgrade to earlier versions.



 Comments   
Comment by Marko Mäkelä [ 2018-09-06 ]

When implementing a new redo log format tag, we must allow downgrade from a clean redo log to earlier versions (10.2 and 10.3), similar to how it was done in MDEV-14909 to allow downgrade from 10.3 to 10.2.

Comment by Marko Mäkelä [ 2018-09-11 ]

With a MLOG_MEMSET operation that I implemented, the mtr.m_impl->m_log.size() in trx_purge_truncate_history() reduced from 694,372 bytes to 37,348 bytes for innodb_page_size=16k. This operation can also be used for reducing the redo log volume for flst_init() on zero-initialized pages, and for replacing the combination of memset() and mlog_log_string().

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