From 7ce56476a609272416f1ffb3c6773ec4ff6408cd Mon Sep 17 00:00:00 2001 From: Michael Boquard Date: Wed, 11 Sep 2024 13:16:39 -0400 Subject: [PATCH] kafka: Fixed oversized alloc in describe_log_dirs Replaced: * std::vector -> chunked_vector * absl::flat_hash_map -> chunked_hash_map Signed-off-by: Michael Boquard --- src/v/kafka/server/handlers/describe_log_dirs.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/v/kafka/server/handlers/describe_log_dirs.cc b/src/v/kafka/server/handlers/describe_log_dirs.cc index 17ec55f9cab81..9de9e6d15dbb8 100644 --- a/src/v/kafka/server/handlers/describe_log_dirs.cc +++ b/src/v/kafka/server/handlers/describe_log_dirs.cc @@ -33,7 +33,7 @@ struct partition_data { }; using partition_dir_set - = absl::flat_hash_map>; + = chunked_hash_map>; static partition_data describe_partition(cluster::partition& p) { auto result = partition_data{ @@ -168,7 +168,7 @@ ss::future describe_log_dirs_handler::handle( chunked_vector local_partitions; chunked_vector remote_partitions; - for (const auto& i : node.mapped()) { + for (const auto& i : node.second) { local_partitions.push_back(i.local); if (i.remote.has_value()) { remote_partitions.push_back(i.remote.value()); @@ -176,12 +176,12 @@ ss::future describe_log_dirs_handler::handle( } local_results.topics.push_back(describe_log_dirs_topic{ - .name = node.key(), + .name = node.first, .partitions = std::move(local_partitions), }); if (!remote_partitions.empty()) { remote_results.topics.push_back(describe_log_dirs_topic{ - .name = std::move(node.key()), + .name = std::move(node.first), .partitions = std::move(remote_partitions), }); }