0
votes

I can see in the json below we get a xid in all jasons written to the kafka.

{"database":"TEST","table":"MAXWELL","type":"insert","ts":1234811111,"**xid**":2009527,"commit":true,"data":{"id":2,"name":"test"}}

What I want to know is,

  1. Is this xid unique for each event.So that I can you that xid to uniquely identify a database event.
  2. This this even is resent for some reason, will that events have the same xid?

Note: I tried re-sending the same event by manually changing the positions.binlog_positions and starting a new maxwell instance in a new server. I got same xids for same events from new maxwell instance.

1

1 Answers

2
votes

xid comes from mysql's binlog, and corresponds to innodb's "transaction_id". It's unique to a transaction, but only in the context of a running server.