Skip to content

MDEV-39459 Fix bad sync pattern for chain replication MTR tests - #5082

Merged
gkodinov merged 1 commit into
MariaDB:11.4from
FarihaIS:mdev-39459-11.4
Aug 7, 2026
Merged

MDEV-39459 Fix bad sync pattern for chain replication MTR tests#5082
gkodinov merged 1 commit into
MariaDB:11.4from
FarihaIS:mdev-39459-11.4

Conversation

@FarihaIS

@FarihaIS FarihaIS commented May 15, 2026

Copy link
Copy Markdown
Contributor

Description

In chain replication (1->2->3), several rpl MTR tests synchronize by calling save_master_gtid on server_1 followed by sync_with_master_gtid on server_3, skipping server_2.

This is unsafe because server_2's binlog dump thread can send events to server_3 before commit_ordered() completes on server_2. Any operations on server_2 that depend on the replicated data can then fail intermittently.

Fix by explicitly syncing server_2 before server_3 in all affected tests, and update result files accordingly.

Release Notes

N/A

How can this PR be tested?

Execute the rpl test suite in mysql-test-run:

--------------------------------------------------------------------------
The servers were restarted 540 times
Spent 2586.221 of 450 seconds executing testcases

Completed: All 1215 tests were successful.

88 tests were skipped, 75 by the test itself.

Basing the PR against the correct MariaDB version

  • This is a bug fix, and the PR is based against the 11.4 branch.

Copyright

All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates several replication tests by adding explicit synchronization steps for server_2. In multi-server replication scenarios, the tests now ensure server_2 is synchronized with the master GTID and saves its state before server_3 performs its synchronization. This change affects multiple test files and their corresponding result files to ensure consistent replication behavior across the chain. I have no feedback to provide.

@FarihaIS
FarihaIS marked this pull request as ready for review May 15, 2026 20:52
@gkodinov gkodinov added the External Contribution All PRs from entities outside of MariaDB Foundation, Corporation, Codership agreements. label May 18, 2026
@gkodinov
gkodinov requested a review from bnestere May 18, 2026 10:28

@gkodinov gkodinov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you for your work! This is a preliminary review.

This is a 11.4 version of #5074. Re-assigning accordingly.

@bnestere bnestere added the Replication Patches involved in replication label Jul 9, 2026

@bnestere bnestere left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me, @FarihaIS , thank you!

@gkodinov
gkodinov enabled auto-merge (rebase) August 5, 2026 12:46
In chain replication (1->2->3), syncing only server_3 after
save_master_gtid on server_1 does not guarantee server_2 has committed,
because server_2's binlog dump thread can send events to server_3 before
commit_ordered() completes on server_2.

Fix affected rpl tests by syncing server_2 before server_3, and update
result files accordingly.

All new code of the whole pull request, including one or several files
that are either new files or modified ones, are contributed under the
BSD-new license. I am contributing on behalf of my employer Amazon Web
Services, Inc.
@gkodinov
gkodinov merged commit 90bea36 into MariaDB:11.4 Aug 7, 2026
16 of 18 checks passed
@FarihaIS
FarihaIS deleted the mdev-39459-11.4 branch August 7, 2026 16:50
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