[fix][io] Fix loading offset issues in Kafka Adaptor#31
Open
kasparjarek wants to merge 1 commit into
Open
Conversation
…ect Adaptor Pulsar Kafka Connect adaptor previously used the same converters for both data and offset storage. This coudl cause various issues. For example when data were using AvroConverter, offsets were serialized using MockSchemaRegistryClient (in memory only). After a connector restart, the fresh MockSchemaRegistryClient had no schema records, causing deserialization to fail with "Subject Not Found; error code: 40401" and the connector losing its offset position. Kafka Connect do not reuse the data converters for offset, but creates new JSON converters configured with `schema.enable` set to `false`. Thus the adaptor was changed to have the same behavior. This is a breaking change for connectors that previously stored offsets in a non-JSON format, those offsets do not have to be readable after upgrade. The offsets probably weren't readable even before this fix (as we can see for the Avro converter). But since we cannot besure what converters users used and how they behaved, this change should be probably included in a major release. Note: The tests for adaptor currently do not compile. We are waiting for matching pulsar artifact to be publihsed. The fix was verified E2E by manual testing. Fixes apache#30
Member
What type of problem are you facing with the tests? |
Author
@lhotari the tests for the adaptor are currently disabled (code link) with a comment:
When trying to run, it's failing with errors like |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #30
Pulsar Kafka Connect adaptor previously used the same converters for both data and offset storage. This could cause various issues. For example when data were using AvroConverter, offsets were serialized using MockSchemaRegistryClient (in memory only). After a connector restart, the fresh MockSchemaRegistryClient had no schema records, causing deserialization to fail with "Subject Not Found; error code: 40401" and the connector losing its offset position.
Kafka Connect do not reuse the data converters for offset, but creates new JSON converters configured with
schema.enableset tofalse. Thus the adaptor was changed to have the same behavior.This is a breaking change for connectors that previously stored offsets in a non-JSON format, those offsets do not have to be readable after upgrade. The offsets probably weren't readable even before this fix (as we can see for the Avro converter). But since we cannot be sure what converters users used and how they behaved, this change should be probably included in a major release.
Note: The tests for adaptor currently do not compile. We are waiting for matching pulsar artifact to be published. The fix was verified E2E by manual testing.