-
Notifications
You must be signed in to change notification settings - Fork 453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Debezium: updating the primary key causes the record to be deleted on the mz side #6553
Comments
@philip-stoev In your initial example,
were the insert and update in the same transaction, or separate, transactions? |
@umanwizard they are separate statements in separate transactions , in separate connections even. |
At least one of the problems here is that Debezium is outputting two records to Kafka for the same LSN, so we think they are duplicates and skip one. Apparently, this happens when the primary key changes; rather than an update, it emits a delete followed by an insert. @JLDLaughlin - are you interested in taking this on? It seems like it might need an upstream fix, to output a third coordinate in the sequence array corresponding to "the Nth record emitted for this LSN" A second possible issue (or maybe something I just don't understand) is that the first coordinate of all the sequence numbers is null here? What does that mean? I couldn't reproduce it locally. (To be clear, this can't be why we're getting wrong answers in Materialize, since we're not using the |
This is clearly top priority, but will take a while to do, and I'm not yet sure who will do it. So I've unassigned myself for now. |
@umanwizard @JLDLaughlin I'd be happy to look into this if you didn't start yet. |
This has no assignee, so I'm assigning to @uce |
I was just trying to reproduce this, but the following test is succeeding for me:
@philip-stoev is there something I'm missing in this test case? |
@JLDLaughlin Apologies for sending you on a wild goose chase -- apparently the issue is no longer reproducible, even after trying various combinations in the test. I am taking up the ticket for myself to clean up the test and push it . Thank you. |
@philip-stoev no worries at all, please feel free to tag me if you find it again! |
Since MaterializeInc#6553 is no longer reproducible, enable the respective .td test. Make sure the table contains records inserted both during the initial snapshot and after it.
A regression test has been pushed. |
Thanks, @philip-stoev ! |
Since MaterializeInc#6553 is no longer reproducible, enable the respective .td test. Make sure the table contains records inserted both during the initial snapshot and after it.
What version of Materialize are you using?
What was the issue?
If you issue the following statements:
then the following Debezium kafka messages will be produced:
Note that there are 4 messages and there is a
null
message second to last, in case this is important. Thenull
message is not there if the table has no primary key or if the primary key is not being changed.and the outcome is that the row is now gone on the Mz side. It seems that the last insertion message was never processed.
Is the issue reproducible? If so, please provide reproduction instructions.
This test is part of a series of tests that intends to run in an mzcompose workflow that sets up Debezium.
Please attach any applicable log files.
The text was updated successfully, but these errors were encountered: