Skip to content
/ server Public

MDEV-28278: mysqlbinlog GTID start-position respects server_id#4760

Open
ChandanaRamakrishna wants to merge 1 commit intoMariaDB:10.11from
ChandanaRamakrishna:10.11
Open

MDEV-28278: mysqlbinlog GTID start-position respects server_id#4760
ChandanaRamakrishna wants to merge 1 commit intoMariaDB:10.11from
ChandanaRamakrishna:10.11

Conversation

@ChandanaRamakrishna
Copy link
Contributor

Fix for MDEV-28278.

mysqlbinlog should respect server_id when evaluating GTID start-position.
Events from different server_id should be skipped until a matching
domain_id + server_id + seq_no is found.

This patch adds server_id validation to ensure behavior matches
replica GTID filtering.

Tested on MariaDB 10.11 build.

@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.


¨Chandana seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@ParadoxV5 ParadoxV5 added External Contribution All PRs from entities outside of MariaDB Foundation, Corporation, Codership agreements. Replication Patches involved in replication labels Mar 9, 2026
Copy link
Contributor

@ParadoxV5 ParadoxV5 left a comment

Choose a reason for hiding this comment

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

Thanks for the work!

Would you mind extending the scope of this PR to include MDEV-37231 – that is, mariadb-binlog should respect server_id even if the position is otherwise found.

Please also include a test or two to prove that the problem is corrected (and to warn future improvements if they’re breaking intended behavior).
MDEV-37231 has a concrete example that you can reference.
(The tests doesn’t have to be fresh new files – adjustments to the test for --start-position (if there is one) also meets the requirements.)

Comment on lines +1134 to +1139
/* MDEV-28278: ensure server_id also matches when evaluating GTID start position */
if (!gtid_event_filter->exclude(&ev_gtid))
{

if (position_gtid_filter && position_gtid_filter->get_num_start_gtids() > 0)
{
Copy link
Contributor

@ParadoxV5 ParadoxV5 Mar 9, 2026

Choose a reason for hiding this comment

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

This approach is incorrect.

  • It’s a manual loop next to and overriding a method call with a very similar purpose.
  • It even works by bypassing the gtid_state_validator section.

The fix to the check should most likely be a part of (that is, inside) exclude() – why should --stop-position not respect server_id, only --start-position?

@ChandanaRamakrishna
Copy link
Contributor Author

ChandanaRamakrishna commented Mar 9, 2026 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

External Contribution All PRs from entities outside of MariaDB Foundation, Corporation, Codership agreements. Replication Patches involved in replication

Development

Successfully merging this pull request may close these issues.

3 participants