Skip to content
/ server Public

Conversation

@andrelkin
Copy link
Contributor

@andrelkin andrelkin commented Jan 21, 2026

The ALTER-ENGINE=MERGE was found out not to have the DDL flag in its Gtid_log_event which is error-prone to the parallel slave. This violates a binlogging requirement that all DDL:s, including all types of ALTER must be binlogged with the flag.

The reason of this exceptional behaviour was an unattended branch of ALTER execution that runs trans_commit_stmt() that cleared already prepared DDL flag from thd->transaction->stmt.m_unsafe_rollback_flags. Later the query gets binlogged stripped from it.

Fixed with applying elsewhere existing pattern (e.g MDEV-8075/228479a28ce7e) to remember-and-restore the original value of m_unsafe_rollback_flags upon the likes of trans_commit_stmt(). This time it's done with arranging a helper StateGuard class to carry out a RAII-like construct as a single-liner.

An mtr test is straightforward and comfortably fits to an existing test file.

The ALTER-ENGINE=MERGE was found out not to have the DDL flag
in its `Gtid_log_even`t which is error-prone to the parallel slave.
This violate a binlogging requirement that all DDL:s, including all
types of ALTER must be binlogged with the flag.

The reason of this exceptional behaviour was an unattended branch of
ALTER execution that run `trans_commit_stmt()` that cleared
already prepared DDL flag from `thd->transaction->stmt.m_unsafe_rollback_flags`.
Later the query gets binlogged stripped from it.

Fixed with applying elsewhere existing pattern (e.g
MDEV-8075/228479a28ce7e) to remember-and-restore the original value of
`m_unsafe_rollback_flags` upon the likes of `trans_commit_stmt()`.
This time it's done with arranging a helper `StateGuard` class
to carry out a RAII-like construct as a single-liner.

An mtr test is straightforward and comfortably fits to an existing
test file.
@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.

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.

5 participants