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

karapace: avoid starting until topic its successfully created #904

Conversation

eliax1996
Copy link
Contributor

Since the underlying create_topics function unless the operation_timeout its async (the effects of this call aren't immediately visible after the call its performed), if karapace its started on a cluster that its slow enough in creating the topic, we get an unhandled exception in the startup of the service of type:

aiokafka.errors.UnknownTopicOrPartitionError: [Error 3] UnknownTopicOrPartitionError

The fix its simple, try to query from the cluster (immediately after having commanded the creation of the topic) the offsets of the topic. If the returned status its OFFSET_UNINITIALIZED we simply need to try again shortly later.

About this change - What it does

References: #xxxxx

Why this way

Since the underlying `create_topics` function unless the `operation_timeout` its async (the effects of this call aren't immediately visible after the call its performed), if karapace its started on a cluster that its slow enough in creating the topic, we get an unhandled exception in the startup of the service of type:
```
aiokafka.errors.UnknownTopicOrPartitionError: [Error 3] UnknownTopicOrPartitionError
```

The fix its simple, try to query from the cluster (immediately after
having commanded the creation of the topic) the offsets of the topic.
If the returned status its `OFFSET_UNINITIALIZED` we simply need to try
again shortly later.
@eliax1996 eliax1996 force-pushed the eliax1996/unknown-topic-shouldnt-affect-start-of-karapace branch 2 times, most recently from 7b969af to 0e18cba Compare June 20, 2024 13:13
@eliax1996 eliax1996 force-pushed the eliax1996/unknown-topic-shouldnt-affect-start-of-karapace branch from 0e18cba to e8467ae Compare June 20, 2024 13:19
@eliax1996 eliax1996 closed this Nov 21, 2024
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

Successfully merging this pull request may close these issues.

1 participant