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

fix: refreshMetadata should retry if topic does not exist and allowAu… #1558

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

regevbr
Copy link

@regevbr regevbr commented Mar 28, 2023

…toTopicCreation is set

fix: #815

Not sure why it happens but it happens randomly. Seems like a race condition when 2 client try to create the same topic at the same time. This fix is tested and working

@hoke-t
Copy link

hoke-t commented May 22, 2023

will this be merged soon?

@atiquefiroz
Copy link

When will this be fixed and merged? @Nevon

@caio-favero
Copy link

Any idea when this will be merged?

@florian-besser
Copy link

This PR looks promising in fixing part (or all of) of #815

Basically ever since Kafka moved from Zookeeper to KRaft there seems to have been a breaking change in auto-topic creation on subscription. It looks like with zookeeper back in the day you could subscribe to a non-existent topic just fine, it would be created behind the scenes and the subscription succeeds. now with KRaft subscribing to a non-existent topic throws KafkaJSProtocolError: This server does not host this topic-partition but still creates the topic afterwards, if auto-topic-creation is enabled.

With this PR the (correct) action of retrying the subscription after waiting a bit seems to be used.

As this PR does not have any reviewers maybe you could have a look @tulios ?

@florian-besser
Copy link

The PR would also close #1563

@HeatherFlux
Copy link

This looks good to go to me.

@Arman92
Copy link
Contributor

Arman92 commented Mar 6, 2024

Any updates on this @Nevon @tulios, can this be merged?

@leppaott
Copy link

This would be nice to have in a new release? 🙏 @Nevon @tulios

kraftp added a commit to dbos-inc/dbos-transact that referenced this pull request May 9, 2024
This PR is a temporary workaround for
tulios/kafkajs#1558 until it gets fixed. If
topic autocreation is on and you try to subscribe to a nonexistent
topic, KafkaJS should retry until the topic is created. However,
curently KafkaJS does not retry, so Transact will instead.
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.

KafkaJS claims a broker does not host a topic-partition, even though it does
8 participants