Skip to content

MDEV-36301 SET GLOBAL innodb_log_file_disabled etc. #4014

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: 10.11
Choose a base branch
from
Draft

Conversation

dr-m
Copy link
Contributor

@dr-m dr-m commented Apr 25, 2025

  • The Jira issue number for this PR is: MDEV-36301

Description

innodb_log_file_disabled: A new Boolean parameter, default OFF. When set ON, dummy log writes will take place and InnoDB will be crash-unsafe. (This has not been properly implemented yet.)

log_t::buf_size_requested: A new data member, separate from buf_size, to reflect innodb_log_buffer_size. When innodb_log_file_disabled=ON, we may switch to use a dummy buffer with a log_sys.buf_size that is much smaller.

Release Notes

TBD

How can this PR be tested?

TODO: modify the automated test suite to verify that the PR causes MariaDB to behave as intended.

Basing the PR against the correct MariaDB version

  • This is a new feature or a refactoring, and the PR is based against the main branch.
  • This is a bug fix, and the PR is based against the earliest maintained branch in which the bug can be reproduced.

This is a new feature. To simplify fixing any unrelated bugs that are found during testing, this is based in the oldest maintained branch where log_sys had been significantly refactored (last in #3925).

PR quality check

  • I checked the CODING_STANDARDS.md file and my PR conforms to this where appropriate.
  • For any trivial modifications to the PR, I am ok with the reviewer making the changes themselves.

@dr-m dr-m self-assigned this Apr 25, 2025
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

The InnoDB log may be disabled by executing
SET GLOBAL innodb_log_file_disabled=ON;
in order to speed up any bulk operations, such as setting up a replica.
After the execution of
SET GLOBAL innodb_log_file_disabled=OFF;
has completed (and InnoDB has written a log checkpoint to the newly
enabled log), the server should be crash-safe again.

log_sys.buf_size_requested: The configured innodb_log_buffer_size.
While the log is disabled, we may set log_sys.buf_size (the actual size)
differently.

log_sys.disabled: The current setting of innodb_log_file_disabled.

log_t::attach(): Handle log_sys.disabled.

log_t::disabled(): Implements SET innodb_log_file_disabled=ON.
Even if the log used to be in persistent memory, here we will
set up dummy log_sys.buf and log_sys.flush_buf so that the dummy
writes will appear to use file based writes.

log_t::skip_write_buf(): A dummy log writer implementation that is
used when log_sys.disabled holds and the log is not being resized.

log_t::resize_start(): Handle log_sys.disabled, that is,
SET GLOBAL innodb_log_file_disabled=OFF when the redo log had
previously been disabled.  If we are on persistent memory,
we will "fake" the dummy log_sys.buf to appear as memory-mapped
as well, so that log_t::resize_write() and log_t::resize_write_buf()
can assume that both log files are of the same type (memory-mapped
or file-based).  The dummy log_sys.flush_buf will be stored in
log_sys.resize_flush_buf in that case.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants