mysql-binlog-connector-java
mysql-binlog-connector-java copied to clipboard
A commitGtid() after a MARIADB_GTID_LIST event only adds one gtid of the list to the GtidSet
I am not familiar with the MariaDB replication protocol, but while reading the code I noticed that:
- when a
MARIADB_GTID_LISTevent occurs, the event data is parsed into aGtidSet - the BinaryLogClient keeps
mariadbGtidListEventData.getMariaGTIDSet().toString()in itsgtidfield, this is a comma separated string of all position map values (could be random order because of hashmap) - when an event occurs that triggers a
commitGtid, the String in gtid is passed to theMariadbGtidSet.addmethod - the add method calls
MariaGtid.parse, which splits on '-', and takes the first 3 items as domainId, serverId and sequence. But the string could contain more gtids which are discarded in this case. - the single MariaGtid is added to the GtidSet
Instead, shouldn't all gtids from the MARIADB_GTID_LIST event be added to the GtidSet?