Skip to content
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

MDEV-35494 fil_space_t::fil_space_t() may be unsafe with GCC -flifetime-dse #3659

Merged
merged 1 commit into from
Dec 11, 2024

Conversation

dr-m
Copy link
Contributor

@dr-m dr-m commented Nov 25, 2024

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

Description

fil_space_t::create(): Instead of invoking the default fil_space_t constructor on a zero-filled buffer, allocate an uninitialized buffer and invoke an explicitly defined constructor on it. Also, specify initializer expressions for all constant data members, so that all of them will be initialized in the constructor.

fil_space_t::being_imported: Replaces part of fil_space_t::purpose.

fil_space_t::is_being_imported(), fil_space_t::is_temporary(): Replaces fil_space_t::purpose.

fil_space_t::id: Changed the type from ulint to uint32_t to reduce incompatibility with later branches that include
commit ca501ff (MDEV-26195).

log_file_op, first_page_init: recv_spaces_t: Use uint32_t for the tablespace id.

Release Notes

This change should not have any noticeable effect.

How can this PR be tested?

This low level code is rather well covered by the regression test suite. As always, some additional stress testing with the random query generator (RQG) will be useful.

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 portability bug fix that would be partly applicable to 10.5, but the 10.5 version would require some nontrivial adjustments, and the 10.5 branch is close to its end of life (EOL).

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 Nov 25, 2024
@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.

@dr-m dr-m force-pushed the 10.6-MDEV-35494 branch 2 times, most recently from 6458cf3 to 9399900 Compare November 26, 2024 06:33
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.

@dr-m The initialization of fil_space_t and other refactoring looks good to me. I have some minor comments/suggestion on the patch. Please have a look.

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.

Thanks @dr-m for addressing the comments. Looks good to me. I have one observation in the latest change.

…me-dse

fil_space_t::create(): Instead of invoking the default fil_space_t
constructor on a zero-filled buffer, allocate an uninitialized buffer
and invoke an explicitly defined constructor on it. Also, specify
initializer expressions for all constant data members, so that all of them
will be initialized in the constructor.

fil_space_t::being_imported: Replaces part of fil_space_t::purpose.

fil_space_t::is_being_imported(), fil_space_t::is_temporary():
Replaces fil_space_t::purpose.

fil_space_t::id: Changed the type from ulint to uint32_t to reduce
incompatibility with later branches that include
commit ca501ff (MDEV-26195).

fil_space_t::try_to_close(): Do not attempt to close files that are
in an I/O bound phase of ALTER TABLE…IMPORT TABLESPACE.

log_file_op, first_page_init: recv_spaces_t:
Use uint32_t for the tablespace id.

Reviewed by: Debarun Banerjee
@dr-m dr-m merged commit 69e20ca into 10.6 Dec 11, 2024
7 of 10 checks passed
@dr-m dr-m deleted the 10.6-MDEV-35494 branch December 11, 2024 13:18
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