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-35363 Avoid cloning of table statistics while saving the InnoDB table stats #3614

Merged
merged 1 commit into from
Nov 14, 2024

Conversation

Thirunarayanan
Copy link
Member

@Thirunarayanan Thirunarayanan commented Nov 7, 2024

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

Description

  • While saving the InnoDB table statistics, InnoDB does clone
    the table object and its statistics to protect the metadata
    in case if table is being dropped. From 10.6 onwards, any
    background task inside InnoDB on the table takes MDL.
    So metadata is protected by MDL of the table. Avoid the
    cloning of the table and its associated index statistics.

How can this PR be tested?

./mtr --suite=innodb

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.

@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

@dr-m dr-m left a comment

Choose a reason for hiding this comment

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

Please push #3614 first, and rebase this once that fix has been merged to 10.6.

For clarity, please file this cleanup as a MDEV. It is not actually fixing what the title says, but removing some code that I had forgotten to remove in 45a05fd.

mysql-test/suite/innodb/r/stat_tables.result Outdated Show resolved Hide resolved
@Thirunarayanan Thirunarayanan force-pushed the 10.6-MDEV-32667 branch 2 times, most recently from 9ec7937 to 51ecff9 Compare November 8, 2024 07:36
@Thirunarayanan Thirunarayanan changed the title MDEV-32667 dict_stats_save_index_stat() reads uninitialized index->stats_error_printed MDEV-35363 Avoid cloning of table statistics while saving the InnoDB table stats Nov 8, 2024
Copy link
Contributor

@dr-m dr-m left a comment

Choose a reason for hiding this comment

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

Thank you, this looks good. I would also suggest removing the test that was added in #3616.

…table stats

- While saving the InnoDB table statistics, InnoDB does clone
the table object and its statistics to protect the metadata
in case if table is being dropped. From 10.6 onwards, any
background task inside InnoDB on the table takes MDL.
So metadata is protected by MDL of the table. Avoid the
cloning of the table and its associated index statistics.
@Thirunarayanan Thirunarayanan merged commit b8f48d0 into 10.6 Nov 14, 2024
11 of 12 checks passed
@Thirunarayanan Thirunarayanan deleted the 10.6-MDEV-32667 branch November 14, 2024 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants