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

Can't reset consumer group offsets in Azure EventHub #217

Open
mwalser opened this issue Sep 23, 2024 · 1 comment
Open

Can't reset consumer group offsets in Azure EventHub #217

mwalser opened this issue Sep 23, 2024 · 1 comment

Comments

@mwalser
Copy link
Member

mwalser commented Sep 23, 2024

We recently had to adjust the offsets of a partition in Azure EventHub. However, it didn't work:

When resetting the offsets while a consumer was active, kafkactl refused to do so. This is expected:

❯ kafkactl reset consumer-group-offset some-consumer-group --topic some-topic --partition 10 --offset 847082914 --execute
cannot reset offsets on consumer group some-consumer-group. There are consumers assigned (state: Stable)

However, after stopping the consumer, resetting the offset was still not possible;:

❯ kafkactl reset consumer-group-offset some-consumer-group --topic some-topic --partition 10 --offset 847082914 --execute
cannot reset offsets on consumer group some-consumer-group. There are consumers assigned (state: Dead)

Looking at the code, setting offsets is only allowed when the consumer group is in state Empty. However, it seems like the Azure EventHub Kafka interface skips the Empty state and goes directly to Dead once no consumer is present on the group. At least that's the observation. I wasn't able to find documentation from Microsoft regarding this behavior.

Using a locally built kafkactl version with the check patched out, resetting the offsets worked even with the consumer group being in the Dead state. Looking at the Kafka command line tool, it also allows resetting the offsets when a group is in the Dead state.

If wanted, I can try to create a PR.

@d-rk
Copy link
Collaborator

d-rk commented Sep 23, 2024

Hey @mwalser

The check was introduced to prevent resetting offsets when the group is in Stable state: c5991de / #43

I guess it is safe to do it in Dead state also.
I would be happy to review your PR for this 🙂

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