Skip to content

Commit

Permalink
Move topic metadata in two more places
Browse files Browse the repository at this point in the history
Topic metadata is potentially large and slow to copy, so this change
moves it in a couple of places we weren't moving it before which
showed up in a large load test profile.
  • Loading branch information
travisdowns committed Jan 31, 2023
1 parent 18214fc commit 0323e74
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/v/kafka/server/handlers/metadata.cc
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,17 @@ create_topic(request_context& ctx, model::topic&& topic) {
metadata_response::topic t;
t.name = std::move(res[0].tp_ns.tp);
t.error_code = map_topic_error_code(res[0].ec);
return ss::make_ready_future<metadata_response::topic>(t);
return ss::make_ready_future<metadata_response::topic>(
std::move(t));
}
auto tp_md = md_cache.get_topic_metadata(res[0].tp_ns);

if (!tp_md) {
metadata_response::topic t;
t.name = std::move(res[0].tp_ns.tp);
t.error_code = error_code::invalid_topic_exception;
return ss::make_ready_future<metadata_response::topic>(t);
return ss::make_ready_future<metadata_response::topic>(
std::move(t));
}

return wait_for_topics(
Expand Down

0 comments on commit 0323e74

Please sign in to comment.