-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Fix offset_manager for Kafka 0.9.0.0 #585
Conversation
4c213c2
to
29f4ca6
Compare
if _, err := offsetManager.ManagePartition("does_not_exist", 123); err != ErrUnknownTopicOrPartition { | ||
t.Fatal("Expected ErrUnknownTopicOrPartition when starting a partition offset manager for a partition that does not exist, got:", err) | ||
} | ||
|
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.
Why did this have to be removed? Is it because the new group protocol is abstract, and potentially could work for other sources besides kafka partitions? (e.g. Kafka Connect). Or is there another reason?
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.
You no longer get back ErrUnknownTopicOrPartition
, you get back ErrNoError
with an offset of -1
(just like you do for topic/partitions that exist but haven't yet had an offset committed). I'm honestly not sure if this is a kafka bug, or an intended behaviour change.
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.
@edenhill ^ ?
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.
Yea, it is just not an error anymore. Whether it is a bug or behaviour change we cannot think of anything smarter than stop checking that.
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.
👍 Given the differences in behavior between Kafka versions, removing this assertion is probably best.
Nice find 👍 |
Very nice find on setting the generation to -1. |
I am having second thoughts about using |
👍 for |
29f4ca6
to
1e5cc31
Compare
Added the constant and squashed. |
Fix offset_manager for Kafka 0.9.0.0
Here is why the solution works.