Skip to content

Conversation

dr-m
Copy link
Contributor

@dr-m dr-m commented May 8, 2025

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

Description

log_t::append_prepare_wait(): Do not attempt to read log_sys.write_lsn because it is not protected by log_sys.latch but by write_lock, which we cannot hold here. The assertion could fail if log_t::write_buf() is executing concurrently, and it has not yet executed log_write_buf() or updated log_sys.write_lsn.

Fixes up #3925

Release Notes

N/A. This replaces a bogus debug assertion.

How can this PR be tested?

Run a write-heavy workload with the default innodb_log_buffer_size and possibly innodb_flush_log_at_trx_commit=0. Possibly, add a sleep to log_write_buf(). If running on Linux /dev/shm, be sure to compile with cmake -DWITH_INNODB_PMEM=OFF in order to cover the correct code path.

I tested this by running the default mtr suites while mysql-test/var was a symbolic link to a SATA device, as well as when it was a regular directory on /dev/shm. That covered both code paths that are affected by these changes.

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.

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.

log_t::append_prepare_wait(): Do not attempt to read log_sys.write_lsn
because it is not protected by log_sys.latch but by write_lock, which
we cannot hold here. The assertion could fail if log_t::write_buf()
is executing concurrently, and it has not yet executed log_write_buf()
or updated log_sys.write_lsn.

Fixes up commit acd071f (MDEV-21923)
@dr-m dr-m self-assigned this May 8, 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.

Copy link
Contributor

@mariadb-DebarunBanerjee mariadb-DebarunBanerjee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks correct to me. The issue should affect debug build only.

@dr-m dr-m merged commit 84dd243 into 10.11 May 8, 2025
12 of 13 checks passed
@dr-m dr-m deleted the 10.11-MDEV-36760 branch May 8, 2025 10:15
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.

4 participants