Repository navigation
inst: always include Master_UUID in ancestry to avoid false errant GTIDs on cascading replicas - #139
Merged
Merged
Conversation
|
Warning Review limit reached
This review includes 2 billable files and costs up to $0.50. Or wait 52 minutes for your next included review. View limit details
|
Errant GTID detection removes the GTIDs of every UUID in the replica's ancestry chain before comparing its executed set with the master's last stored executed_gtid_set. This avoids false positives when the master's data is staler than the replica's. The ancestry chain, however, was built only from the master's *stored* ancestry_uuid plus the instance's own server_uuid; the instance's Master_UUID was only added for co-masters. When orchestrator cannot read an upstream server (e.g. an AWS RDS source shown as 'unknown,invalid'), that server's UUID never enters the chain. Replicas further down then report the source's transactions as errant whenever they're ahead of the intermediate master's last poll, producing constantly flapping GTID:errant states with a moving range. Always add Master_UUID to the ancestry (deduplicated). When the master is readable this is a no-op: its stored ancestry already ends with its own UUID. The ancestry and redaction logic is extracted into computeAncestryUUID() and redactExecutedGtidSetForErrantCheck() so it can be unit tested. Reported in percona#88. Fixes #137
renecannao
force-pushed
the
fix/errant-gtid-cascading
branch
from
November 20, 2026 05:29
30cc265 to
faf27d2
Compare
4 of 5 tasks
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.
Fixes #137 (copied from percona#88).
Problem
Errant GTID detection removes the GTIDs of every UUID in the replica's
AncestryUUIDbefore comparing against the master's last storedexecuted_gtid_set. That's how stale master data is supposed to be tolerated. But the chain was built only from the master's storedancestry_uuidplus the instance's own UUID.Master_UUIDwas added only for co-masters.If orchestrator can't read an upstream server (for example an RDS source shown as
unknown,invalid), that server's UUID never enters the chain. Leaves then report the source's transactions as errant whenever they're ahead of the intermediate master's last poll. The result is a flappingGTID:errantwith a range that keeps moving.Fix
computeAncestryUUID()always includesMaster_UUID, deduplicated. When the master is readable nothing changes, because its stored ancestry already contains its own UUID. Co-master and group-replication handling are unchanged.computeAncestryUUID,redactExecutedGtidSetForErrantCheck) so it can be unit tested.Transactions written locally on a replica are still reported as errant.
Verification
Unit tests (
go/inst/instance_dao_ancestry_test.go): 3 of the 6 new tests fail onmasterand all pass with the fix.go test ./go/...andgo vet ./go/inst/pass.End-to-end with Docker
mysql:8.0:src → inter → {leaf1, leaf2}, with continuous inserts onsrc. orchestrator has no user onsrc, to simulate RDS. Sampled/api/clusterevery 2s for 90s:<src-uuid>:4476-4502, then:4646-4672, …Real errant check, with this PR: a
CREATE DATABASErun directly onleaf1is reported asleaf1 errant=[<leaf1-uuid>:1], andleaf2stays clean.Known limitation (unchanged)
Errant GTIDs on the intermediate master itself still can't be detected while its master is unreadable, because there's no master GTID set to compare against.