-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
KAFKA-15800: Prevent DataExceptions from corrupting KafkaOffsetBackingStore #14718
KAFKA-15800: Prevent DataExceptions from corrupting KafkaOffsetBackingStore #14718
Conversation
…gStore Signed-off-by: Greg Harris <greg.harris@aiven.io>
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.
Thanks for the fix, Greg! The change itself makes sense to me, but I was just wondering about the scenarios that would lead to something like this occurring? The offsets that the source connector generates would be serialized in the runtime by the JSON converter itself before being written to the offsets topic. Is this fix for cases where connectors or operators directly produce bad data to the offsets topic for a Connect cluster?
connect/runtime/src/test/java/org/apache/kafka/connect/storage/OffsetUtilsTest.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Greg Harris <greg.harris@aiven.io>
I do not know how we got malformed data in the topic exactly, but the invalid records did appear to be almost valid source offsets, they were just missing a double quote in the middle of the key. It may have been from a bad converter version, a bit flip, or something else, I can't be sure. It may have been an operator mis-typing during a manual remediation, I just don't have direct evidence for that. If that was the case, KIP-875 (which introduced this bug) should also make it less likely in the future. |
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.
LGTM, thanks Greg!
Test failures appear unrelated, and the connect and mirror tests pass locally. |
…gStore (#14718) Signed-off-by: Greg Harris <greg.harris@aiven.io> Reviewers: Yash Mayya <yash.mayya@gmail.com>
…gStore (#14718) Signed-off-by: Greg Harris <greg.harris@aiven.io> Reviewers: Yash Mayya <yash.mayya@gmail.com>
…gStore (apache#14718) Signed-off-by: Greg Harris <greg.harris@aiven.io> Reviewers: Yash Mayya <yash.mayya@gmail.com>
…gStore (apache#14718) Signed-off-by: Greg Harris <greg.harris@aiven.io> Reviewers: Yash Mayya <yash.mayya@gmail.com>
…gStore (apache#14718) Signed-off-by: Greg Harris <greg.harris@aiven.io> Reviewers: Yash Mayya <yash.mayya@gmail.com>
…gStore (apache#14718) Signed-off-by: Greg Harris <greg.harris@aiven.io> Reviewers: Yash Mayya <yash.mayya@gmail.com>
https://issues.apache.org/jira/browse/KAFKA-15800
The JsonConverter may throw DataException when encountering malformed data. This causes part or all of the batch of ConsumerRecords from the KafkaBasedLog consumer to be dropped, corrupting the state of the KafkaOffsetBackingStore.
This is a narrow-scope fix for just the KafkaOffsetBackingStore, and i'd like to follow up with a fix to the KafkaBasedLog to make these sorts of mistakes less impactful in the future.
Committer Checklist (excluded from commit message)