Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Fix topic creation may not complete after METADATA response is sent #506

Conversation

BewareMyPower
Copy link
Collaborator

@BewareMyPower BewareMyPower commented May 16, 2021

Motivations

Sometimes DifferentNamespaceTest may fail, after checking the logs I found send failed.

Failed to send 0: This server is not the leader for that topic-partition

Kafka 2.0 client's default retry config is 0, so it won't attempt to send message again.

It's because when KoP handled PRODUCE request, the PersistentTopic instance of broker was not created. It's because when a topic was automatically created, an asynchronous method was called but METADATA response future didn't wait for it. The followed lookup request doesn't need a topic to be created.

Modifications

When a METADATA request is handled and a topic is created automatically, wait until the topic creation is completed.

@BewareMyPower BewareMyPower self-assigned this May 16, 2021
Copy link
Collaborator

@hangc0276 hangc0276 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@dockerzhang dockerzhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@BewareMyPower BewareMyPower merged commit 8b15fad into streamnative:master May 18, 2021
@BewareMyPower BewareMyPower deleted the bewaremypower/fix-handle-metadata branch May 18, 2021 09:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants