GTID 1/5: Introduce BinlogCoordinate abstraction (file/position backed)#445
Open
driv3r wants to merge 1 commit into
Open
GTID 1/5: Introduce BinlogCoordinate abstraction (file/position backed)#445driv3r wants to merge 1 commit into
driv3r wants to merge 1 commit into
Conversation
Add a representation-agnostic BinlogCoordinate type as the seam for a
future GTID binlog-coordinate mode, without changing current behavior.
- BinlogCoordinate wraps mysql.Position today (type "file_position"),
with "gtid" reserved. Provides IsZero/Compare/String and
self-describing JSON that also decodes bare {Name,Pos} payloads for
backward compatibility.
- StateTracker/SerializableState gain coordinate accessors and mutators
that delegate to the existing file/position storage; legacy
mysql.Position API and serialized fields are unchanged.
- DMLEvent gains BinlogCoordinate()/ResumableBinlogCoordinate() and
BinlogStreamer gains GetLastStreamedBinlogCoordinate().
- Add unit tests for coordinate basics, comparison, and JSON round-trip
(including legacy decode paths).
No behavior change: everything still runs on file/position. This is the
foundation for adding GTID support behind a feature flag.
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.
Stacked PR 1 of 5 — GTID support
This is the first PR in a stack that adds opt-in GTID binlog-coordinate support to Ghostferry, keeping file/position as the default and fully backward compatible.
Stack
mainWhat this PR does
Introduces a representation-agnostic
BinlogCoordinatetype as the seam for a future GTID mode, without changing current behavior.BinlogCoordinatewrapsmysql.Positiontoday (typefile_position), withgtidreserved. ProvidesIsZero/Compare/Stringand self-describing JSON that also decodes bare{Name,Pos}payloads for backward compatibility.StateTracker/SerializableStategain coordinate accessors that delegate to the existing file/position storage; legacymysql.PositionAPI and serialized fields are unchanged.DMLEventgainsBinlogCoordinate()/ResumableBinlogCoordinate();BinlogStreamergainsGetLastStreamedBinlogCoordinate().No behavior change: everything still runs on file/position. This is the foundation for adding GTID support behind a feature flag.