Is transaction marker supported for mysql connector?

24 views
Skip to first unread message

mhv

unread,
Apr 12, 2021, 6:12:30 PMApr 12
to debezium
Is transaction marker supported for mysql connector. 
If yes, how can it be used with Debezium Embedded ?

Note: Tried setting `provide.transaction.metadata=true` in connector config but that did not work. I see the transaction field in the record payload but the value is null.


"payload": {
"key": {
"id": 125
},
"value": {
"before": null,
"after": {
"id": 125,
"k": 1,
"c": "1",
"pad": "1"
},
"source": {
"version": "1.4.0",
"connector": "mysql",
"name": "app.sbtest.sbtest1",
"ts_ms": 1618261382000,
"snapshot": "false",
"db": "sbtest",
"table": "sbtest1",
"server_id": 1,
"gtid": null,
"file": "mysql-bin.000008",
"pos": 2418,
"row": 0,
"thread": 213,
"query": null
},
"op": "c",
"ts_ms": 1618264640848,
"transaction": null


Is there any other way of getting the transaction id ?


jiri.p...@gmail.com

unread,
Apr 13, 2021, 3:30:51 AMApr 13
to debezium
Hi,

are you on 1.5? That metadat are available only in this version?

J.

mhv

unread,
Apr 14, 2021, 3:16:09 PMApr 14
to debezium
Thanks. I was using 1.4. Tested with 1.5 and I can see the transaction marker.

Follow up question - 
Is it possible to get the commit id (xid) for the transaction?

jiri.p...@gmail.com

unread,
Apr 16, 2021, 4:45:47 AMApr 16
to debezium
Hi,

no XIDs are not supported as transaction IDs.

J.

mhv

unread,
Apr 16, 2021, 1:01:57 PMApr 16
to debezium
If we want to support it - say output the Xid instead of the id in transaction marker, where in the debezium code should the changes happen?
Want to see if we can implement the changes required by us. 

Thanks

jiri.p...@gmail.com

unread,
Apr 18, 2021, 11:47:25 PMApr 18
to debezium
Hi,

please see io.debezium.connector.mysql.MySqlStreamingChangeEventSource.handleTransactionCompletion(Event) and io.debezium.connector.mysql.MySqlStreamingChangeEventSource.handleQueryEvent(Event)

The problem with XID is that arrives at the end of the transaction but you need to add it to metadata of data events that arrived before it.

J.

Reply all
Reply to author
Forward
0 new messages