-
Notifications
You must be signed in to change notification settings - Fork 3k
Kafka Connect: validate table uuid on commit #14979
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
Changes from all commits
709587a
026bf07
3b445da
36fbc36
af9be7d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -193,6 +193,7 @@ private String offsetsToJson(Map<Integer, Long> offsets) { | |
| } | ||
| } | ||
|
|
||
| @SuppressWarnings("checkstyle:CyclomaticComplexity") | ||
| private void commitToTable( | ||
| TableReference tableReference, | ||
| List<Envelope> envelopeList, | ||
|
|
@@ -207,6 +208,14 @@ private void commitToTable( | |
| return; | ||
| } | ||
|
|
||
| if (!Objects.equals(table.uuid(), tableReference.uuid())) { | ||
| LOG.warn( | ||
| "Skipping commits to table {} due to target table mismatch. Expected: {} Received: {}", | ||
| tableIdentifier, | ||
| table.uuid(), | ||
| tableReference.uuid()); | ||
|
Comment on lines
+212
to
+216
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we need to return here ? seems like we are just logging ?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch, we need to return here.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll open a PR to address these two issues, I approved a little too soon. |
||
| } | ||
|
|
||
| String branch = config.tableConfig(tableIdentifier.toString()).commitBranch(); | ||
|
|
||
| // Control topic partition offsets may include a subset of partition ids if there were no | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder the case where lets say some one does a library upgrade and it has events without the uuid in the tableReference, what would happen in this case ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The events will be skipped. We should probably only check the UUID if the ref UUID is not null, even though that isn't ideal.