-
Notifications
You must be signed in to change notification settings - Fork 53
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
Offset reset policy isn't applied for offsets out of range. #71
Comments
Can this exception happen in BroadwayKafka, considering it never uses external input as the offset, only rely on information given by kafka? |
Yeah, seems like it can, however I'm not sure of the exact mechanism which caused it:
I think maybe this offset was deleted due to the retention period, which you'd think would mean the |
Does it happen consistently? Or maybe it was a race condition indeed? |
Manually restarting the (Elixir) application didn't resolve the issue, I thought that there may have been some state somewhere which wasn't cleared when the producer crashed, but this isn't the case. I checked the broker settings and the |
Oh, so we are permanently requesting an offset that is no longer available? If so, Yeah, we should consider resetting it even in those cases. A PR is welcome! |
Regarding the mechanism, my current thinking is that this application wasn't able to connect for 7 days (maybe some certificate issue due to rolling certs), after which time the events were deleted due to the retention period, then upon reconnecting we get this error. This seems to be the most plausible scenario. |
I think this should be closed per #72 :) |
When the
BroadwayKafka.Producer
receives new assignments from from the :brod_group_coordinator the offset reset policy isn't applied for offsets which are out of range, but rather only for offsets that are:undefined
. See: https://github.com/dashbitco/broadway_kafka/blob/main/lib/broadway_kafka/brod_client.ex#L130.I expected the
:offset_reset_policy
to behave as per the:brod_consumer
documentationSeems like the
:offset_reset_policy
should be handled in the fetch function (catch the:offset_out_of_range
error and try again?)The text was updated successfully, but these errors were encountered: