feat: stream MariaDB GTIDs
Merged
RE
2mo ago+1342+1342+0123456789012345678901234567890123456789-34-34-01234567890123456789
Summary
- Add MariaDB
domain-server-seqGTID parsing and watermark serialization. - Auto-detect the reader snapshot GTID format and use
@@gtid_binlog_poswhen the executed-set column is absent. - Stream MariaDB
GTID_EVENTas the existingST=/I1=/I2=wire protocol with the domain as the id. - Add a live MariaDB 10.11 integration service and TAP coverage.
Test plan
make -C test/tap./test/tap/tests/test_mariadb_gtid-t42/42./test/tap/tests/test_mariadb_gtid_stream-t3/3 against MariaDB 10.11.18
Summary by cubic
Adds MariaDB GTID support to the binlog reader so it can snapshot and stream domain-server-sequence GTIDs on the existing ST=/I1=/I2= wire protocol.
- Auto-detects MySQL vs MariaDB GTID strings; a present non-empty executed-set column is parsed with the auto-detecting parser and malformed text fails startup, while a missing or empty column falls back to
@@gtid_binlog_pos(an empty value is a valid empty position before the server's first GTID). - Streams MariaDB
GTID_EVENTwith the domain as the wire id and sequence as the transaction id;@mariadb_slave_capabilityis now sent only to MariaDB servers. to_string()keeps the wire format for domain keys (0:1-270); newto_display_string()emits the native0-1-270form.- Rejects domain/server ids wider than
UINT32_MAXinstead of truncating them, and skips re-delivered GTIDs already covered by the snapshot position. - Adds a MariaDB 10.11 docker-compose service and live TAP coverage (
test_mariadb_gtid_stream-t) that pins the reader output against a shared wire-contract fixture duplicated in the ProxySQL repository.
Summary by CodeRabbit
- New Features
- Added support for reading MariaDB GTID positions from snapshots and live binlog streams, including positions across multiple domains. Existing replication message formats remain unchanged.
- MariaDB GTID positions can be displayed with domain, server ID, and sequence information. MySQL GTID handling remains supported.
- Bug Fixes
- Improved snapshot handling when MariaDB does not provide a MySQL-style executed GTID set. Empty positions are accepted, while malformed or out-of-range GTID data is rejected.
- Duplicate GTIDs no longer generate redundant position updates.