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

SR transaction crashes with innodb_snapshot_isolation. #3617

Open
wants to merge 2 commits into
base: 10.6
Choose a base branch
from

Conversation

sciascid
Copy link
Contributor

@sciascid sciascid commented Nov 7, 2024

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

Description

Make galera streaming replication feature compatible with the new innodb-snapshot-isolation option. Fragment removal during commit of streaming replication transaction would fail due to snapshot isolation write-write conflicts.

Release Notes

Using Galera's streaming replication feature, in combination with innodb-snapshot-isolation, could result in server crashes or transactions that would be rolled back unnecessarily.

How can this PR be tested?

The pull request includes a MTR test case.

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.

@janlindstrom janlindstrom added the Codership Codership Galera label Nov 7, 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.

OK to push after addressing my comments.

sql/sql_class.h Outdated Show resolved Hide resolved
storage/innobase/lock/lock0lock.cc Outdated Show resolved Hide resolved
Ignore snapshot isolation conflict during fragment removal, before
streaming transaction commits. This happens when a streaming
transaction creates a read view that precedes the INSERTion of
fragments into the streaming_log table. Fragments are INSERTed
using a different transaction. These fragment are then removed
as part of COMMIT of the streaming transaction. This fragment
removal operation could fail when the fragments were not part
the transaction's read view, thus violating snapshot isolation.
Make galera_sr.GCF-572 behave the same with and without option
innodb-snapshot-isolation. It is sufficient to remove a SELECT
statement from a transaction to delay the creation of the read
view in innodb. Avoiding the detection of a write-write conflict
under innodb-snapshot-isolation.
@sciascid
Copy link
Contributor Author

@dr-m addressed all the comments.

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