-
Feature Request
-
Resolution: Unresolved
-
Major
-
1.7.0.Final, 1.7.1.Final, 1.8.0.Alpha2
-
None
-
False
-
False
-
0
-
0%
-
MS SQL "translates" some update statements to delete + insert in CDC . This means that for some updates, Kafka (rightfully) produces Delete, Null (if tombstone is enable) then Create events.
This is described in https://docs.microsoft.com/en-US/troubleshoot/sql/replication/update-statements-replicated-as-delete-insert
If you have a table with a unique index on the "name" column for example, if you issue
update dbzClient set name = 'Client__1' where id = 1;
the CDC table will record 2 events (operation 3 and 4) which is an update with respectively value before, value after - as I would expect.
If now, you run
update dbzClient set name = name + '__' where id < 3;
which updates 2 rows for example, you'll have as expected 4 CDC entries in the table BUT the operation will be twice 1 (delete) followed by twice 2 (insert)!
And this despite there is a FK that reference those records.