Skip to content

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

Open
FarihaIS wants to merge 1 commit into
MariaDB:12.3from
FarihaIS:mdev-39459-12.3
Open

MDEV-39459 Fix bad sync pattern for chain replication MTR tests#5084
FarihaIS wants to merge 1 commit into
MariaDB:12.3from
FarihaIS:mdev-39459-12.3

Conversation

@FarihaIS
Copy link
Copy Markdown
Contributor

@FarihaIS FarihaIS commented May 15, 2026

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 556 times
Spent 3126.315 of 533 seconds executing testcases

Completed: All 1234 tests were successful.

83 tests were skipped, 69 by the test itself.

Basing the PR against the correct MariaDB version

  • This is a bug fix, and the PR is based against the 12.3 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.

Copy link
Copy Markdown

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

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 to ensure proper synchronization across a multi-server topology (1->2->3). By explicitly syncing server_2 with the master's GTID before server_3, the tests now correctly account for the intermediate node in the replication chain. Feedback was provided regarding the deletion of the rpl_extra_col_slave_rebinlog.test file, requesting clarification on why it was removed instead of being updated with the new synchronization pattern.

Comment thread mysql-test/suite/rpl/t/rpl_extra_col_slave_rebinlog.test
@FarihaIS FarihaIS marked this pull request as ready for review May 15, 2026 20:52
@FarihaIS FarihaIS force-pushed the mdev-39459-12.3 branch 2 times, most recently from c6e12d7 to 1164902 Compare May 15, 2026 21:47
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant