Skip to content
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

Tolerate misbehaving 3rd party kafka clients with wrong member metadata #493

Closed
krvladislav opened this issue Jul 5, 2023 · 4 comments
Closed

Comments

@krvladislav
Copy link

I test migration from segmentio/kafka-go to franz-go and I met errors like next one when deploy franz-go version application over kafka-go version:

join and sync loop errored%!(EXTRA string=group, string=results, string=err, *errors.errorString=unable to create group member balancer: unable to read member metadata: response did not contain enough data to be valid, string=consecutive_errors, int=1, string=backoff, time.Duration=253.795577ms)

If I am not mistaken, there is a misbehavior in kafka-go segmentio/kafka-go#1156, which sends member metadata v1 version without OwnedPartitions that doesn't comply Kafka Protocol. When decoding metadata, franz-go expects OwnedPartitions must be provided and return the error https://github.com/twmb/franz-go/blob/master/pkg/kmsg/generated.go#L1653

My suggestion is to provide soft handling like sarama does here https://github.com/Shopify/sarama/blob/main/consumer_group_members.go#L43 . It will help to migrate from another kafka clients to franz-go smoothly.

Kafka Version
2.6.0.0
franz-go
v1.13.4

@twmb
Copy link
Owner

twmb commented Jul 7, 2023

I'll add a workaround that, if the first two bytes are {0, 1} and the decoding fails, retries as v0.

I'll leave this workaround only for v1 at the moment -- hopefully clients don't claim higher and higher support without actually supporting the higher protocol fields.

twmb added a commit that referenced this issue Jul 7, 2023
@twmb
Copy link
Owner

twmb commented Jul 7, 2023

Specifically this commit, if you want to give it a shot: 2572b9a
I aim to merge soonish.

@twmb twmb mentioned this issue Jul 7, 2023
17 tasks
twmb added a commit that referenced this issue Jul 8, 2023
@twmb twmb closed this as completed in 00e4e76 Jul 8, 2023
@krvladislav
Copy link
Author

Great, thanks for the fast response

@krvladislav
Copy link
Author

I tried 1.14.1 on a migration from segmentio/kafka-go and now it works smoothly. Thanks for the resolution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants