Skip to content
/ server Public

Comments

MDEV-28213 Skip ignored domain IDs during GTID validation#4677

Open
bodyhedia44 wants to merge 1 commit intoMariaDB:10.6from
bodyhedia44:MDEV-28213-fix-ignored-domain-validation
Open

MDEV-28213 Skip ignored domain IDs during GTID validation#4677
bodyhedia44 wants to merge 1 commit intoMariaDB:10.6from
bodyhedia44:MDEV-28213-fix-ignored-domain-validation

Conversation

@bodyhedia44
Copy link

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:

  • contains_all_slave_gtid(): skip domains not needed by the slave when
    searching for the right binlog file
  • check_slave_start_position(): skip validation for domains the slave
    does not care about
  • gtid_find_binlog_file(): pass the ignore/do lists through to the above

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.

@CLAassistant
Copy link

CLAassistant commented Feb 21, 2026

CLA assistant check
All committers have signed the CLA.

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.
@bodyhedia44 bodyhedia44 force-pushed the MDEV-28213-fix-ignored-domain-validation branch from 988af46 to 155d0fe Compare February 21, 2026 14:28
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.

2 participants