MDEV-28213 Skip ignored domain IDs during GTID validation#4677
Open
bodyhedia44 wants to merge 1 commit intoMariaDB:10.6from
Open
MDEV-28213 Skip ignored domain IDs during GTID validation#4677bodyhedia44 wants to merge 1 commit intoMariaDB:10.6from
bodyhedia44 wants to merge 1 commit intoMariaDB:10.6from
Conversation
When a slave connects to a master using MASTER_USE_GTID=Slave_Pos, the master validates the slave's GTID state against the oldest available binlog's Gtid_list event. If the master has purged old binlogs and the Gtid_list references domains that the slave is configured to ignore (via CHANGE MASTER IGNORE_DOMAIN_IDS or DO_DOMAIN_IDS), validation would incorrectly fail with error 1236 even though the slave does not need events from those domains. Fix: the slave now sends its configured IGNORE_DOMAIN_IDS and DO_DOMAIN_IDS to the master as user variables before issuing COM_BINLOG_DUMP. The master reads these and skips validation for ignored domains in contains_all_slave_gtid(), check_slave_start_position(), and gtid_find_binlog_file(). This is backwards compatible: older masters ignore the unknown user variables, and older slaves simply do not send them.
988af46 to
155d0fe
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a slave connects to a master using MASTER_USE_GTID=Slave_Pos and the
master has purged old binlogs, the master validates the slave's GTID state
against the oldest available binlog's Gtid_list event. If the Gtid_list
references domains that the slave is configured to ignore (via
CHANGE MASTER IGNORE_DOMAIN_IDS or DO_DOMAIN_IDS), validation incorrectly
fails with error 1236:
"Could not find GTID state requested by slave in any binlog files.
Probably the slave state is too old and required binlog files have
been purged."
This is a false rejection -- the slave does not need events from those domains.
Fix: the slave now sends its IGNORE_DOMAIN_IDS and DO_DOMAIN_IDS to the master
as user variables (@slave_connect_state_domain_ids_ignore and
@slave_connect_state_domain_ids_do) before COM_BINLOG_DUMP. The master reads
these and skips validation for ignored domains in three code paths:
searching for the right binlog file
does not care about
This is backwards compatible: older masters store the unknown user variables
harmlessly, and older slaves simply do not send them.
Includes MTR test rpl.rpl_gtid_ignored_domain_ids_validation covering both
IGNORE_DOMAIN_IDS and DO_DOMAIN_IDS scenarios with purged binlogs.