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-35018 MDL BF-BF conflict on DROP TABLE #3568

Open
wants to merge 1 commit into
base: 10.5
Choose a base branch
from

Conversation

sciascid
Copy link
Contributor

@sciascid sciascid commented Oct 8, 2024

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

Description

The patch fixes a case where two Galera appliers would conflict at MDL level, while
applying "DROP TABLE child" and "UPDATE parent". Where "child" has a foreign key
to table "parent". DROP TABLE takes MDL locks on both child and its parent table,
however insufficient galera certifications keys were appended, which caused these
two operation to apply concurrently.

Release Notes

Nothing.

How can this PR be tested?

The patch comes with MTR tests.

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.

DROP TABLE on child and UPDATE of parent table can cause an MDL BF-BF
conflict when applied concurrently.
DROP TABLE takes MDL locks on both child and its parent table, however
it only it did not add certification keys for the parent table.
This patch adds the following:
 * Append certification keys corresponding to all parent tables
   before DROP TABLE replication.
 * Fix wsrep_append_fk_parent_table() so that it works when it is
   given a table list containing temporary tables.
 * Make sure function wsrep_append_fk_parent_table() is only called
   for local transaction. That was not the case for ALTER TABLE.
 * Add a test case that verifies that UPDATE parent depends on
   preceeding DROP TABLE child.
 * Adapt galera_ddl_fk_conflict test to work with DROP TABLE as well.
@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.

@janlindstrom janlindstrom added the Codership Codership Galera label Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Codership Codership Galera
Development

Successfully merging this pull request may close these issues.

4 participants