Skip to content

MDEV-35570 parallel slave ALTER-SEQUNCE attemted to binlog out-of-order #4043

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

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

Conversation

andrelkin
Copy link
Contributor

The description is copied from the commit message of the initial branch's commit

Since MDEV-31503 fixes ALTER-SEQUENCE might be able to complete its
work including binlogging before a preceding in binlog-order
transaction. There may not be data dependency between the two
transactions, but there would be
"an attempt was made to binlog GTID D-S-XYZ which would create an
out-of-order sequence number"
error in the gtid_strict_mode = ON.

After the preceding transaction started committing, and does is very
slow, ALTER-SEQUNCE was able to find a time window to complete because
it temporarily releases its link with the waitee parent transaction.
And while having released it it also erroneously executed binlogging part.

Fixed with restoring the commit dependency on the parent before
ALTER-SEQUNCE takes on binlogging.

@andrelkin andrelkin requested review from bnestere and knielsen May 13, 2025 14:31
@CLAassistant
Copy link

CLAassistant commented May 13, 2025

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
Member

@knielsen knielsen left a comment

Choose a reason for hiding this comment

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

Thanks Andrei!

Approved after fixing the correct save/restore of globals in the test case as noted in detailed comments.

Also looks like this needs rebasing before merging to main, there are extra commits included unrelated to this fix.

#
--connection slave
--source include/stop_slave.inc
--let $saved_mode= @@global.slave_parallel_mode
Copy link
Member

Choose a reason for hiding this comment

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

This looks wrong. The $saved_mode will be a string containing "@@glob...", not the actual value of the slave_parallel_mode which was probably intended.

Use the normal way: SET @saved_mode= @@global.slave_parallel_mode . This also avoids getting the value into the .result file when restoring, causing the test to fail if run with some non-standard --mysqld=--slave-parallel-mode option

# allow to proceed to sync with the 1st following WFPT2SC wait condtion
lock table ti write;
# allow to proceed into commit to sync with the 2nd following WFPC wait condition
--let $saved_dbug= @@GLOBAL.debug_dbug
Copy link
Member

Choose a reason for hiding this comment

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

Again, use: SET @saved_dbug= @@GLOBAL.debug_dbug

@andrelkin andrelkin changed the base branch from main to 10.6 May 22, 2025 14:11
…rder

_(This is the 1st of two commits to reproduce the issue; the 2nd
commits that follow fixes it)_

Since MDEV-31503 fixes ALTER-SEQUENCE might be able to  complete its
work including binlogging before a preceding in binlog-order
transaction. There may not be data dependency between the two
transactions, but there would be
   "an attempt was made to binlog GTID D-S-XYZ which would create an
   out-of-order sequence number"
error in the gtid_strict_mode = ON.

After the preceding transaction started committing, and does is very
slow, ALTER-SEQUNCE was able to find a time window to complete because
it temporarily releases its link with the waitee parent transaction.
And while having released it it also erroneously executed binlogging part.

Fixed with restoring the commit dependency on the parent before
ALTER-SEQUNCE takes on binlogging.
@andrelkin andrelkin force-pushed the bb-10.6-MDEV-35570 branch from 0a08f55 to f195bef Compare May 23, 2025 09:20
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