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

KAFKA-3640: Reduce the latency of topic metadata requests #1303

Closed
wants to merge 5 commits into from

Conversation

fpj
Copy link
Contributor

@fpj fpj commented May 1, 2016

Changes based on KAFKA-2073 to reduce the latency of metadata requests.

new TopicMetadata(topic, Seq.empty[PartitionMetadata], ErrorMapping.InvalidTopicCode)
}
if (topic == GroupCoordinator.GroupMetadataTopicName) {
createGroupMetadataTopic()
Copy link
Contributor

Choose a reason for hiding this comment

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

Love the cleanup. Thank you.

@gwenshap
Copy link
Contributor

gwenshap commented May 2, 2016

First, thanks for the cleanup. It looks fantastic.
The latency reduction is mostly from use of "hasTopicMetadata" when possible instead of "getTopicMetadata"? Or am I missing another performance win?

Did you do before / after tests for latency, or is this "common sense optimization"? (either is fine, but if you have numbers, do share...)

And last but not least, should this go into 0.10.0 branch? It looks like a harmless refactoring, but I have to admit that anything that touches the metadata cache is a bit scary and we may want to give this more time to "bake". @ijuma - your thoughts?

@ijuma
Copy link
Contributor

ijuma commented May 2, 2016

@gwenshap This is a backport of a change that is already in trunk and 0.10.0 (KAFKA-2073). The backport is more conservative as if doesn't use the new Java request classes.

The PR for KAFKA-2073 includes some benchmark numbers and this backport has been tested in a large deployment where it caused a significant reduction in latency.

One of the improvements is the one you mentioned. The other is that we avoid unnecessary collection copies in getTopicMetadata

@gwenshap
Copy link
Contributor

gwenshap commented May 2, 2016

@ijuma and @fpj - sorry for not noticing it is a 0.9.0.0 patch and backport of another change.

LGTM

@guozhangwang
Copy link
Contributor

LGTM.

asfgit pushed a commit that referenced this pull request May 2, 2016
Changes based on KAFKA-2073 to reduce the latency of metadata requests.

Author: Flavio Junqueira <fpj@apache.org>

Reviewers: Gwen Shapira

Closes #1303 from fpj/KAFKA-3640
@ijuma
Copy link
Contributor

ijuma commented May 2, 2016

@fpj This was merged by Gwen. Can you please close the PR? (only PRs to trunk are auto-closed sadly).

@fpj
Copy link
Contributor Author

fpj commented May 3, 2016

@ijuma Ok
@gwenshap Thanks for reviewing and merging!

@fpj fpj closed this May 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants