kafkajs icon indicating copy to clipboard operation
kafkajs copied to clipboard

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

Open regevbr opened this issue 1 year ago • 8 comments

…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

regevbr avatar Mar 28 '23 19:03 regevbr

will this be merged soon?

hoke-t avatar May 22 '23 20:05 hoke-t

When will this be fixed and merged? @Nevon

atiquefiroz avatar Aug 18 '23 13:08 atiquefiroz

Any idea when this will be merged?

caio-favero avatar Sep 05 '23 19:09 caio-favero

This PR looks promising in fixing part (or all of) of https://github.com/tulios/kafkajs/issues/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 avatar Sep 12 '23 09:09 florian-besser

The PR would also close https://github.com/tulios/kafkajs/issues/1563

florian-besser avatar Sep 12 '23 09:09 florian-besser

This looks good to go to me.

HeatherFlux avatar Oct 25 '23 19:10 HeatherFlux

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

Arman92 avatar Mar 06 '24 17:03 Arman92

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

leppaott avatar Apr 17 '24 08:04 leppaott