diff --git a/src/v/kafka/server/BUILD b/src/v/kafka/server/BUILD index bf60c41b8499b..48a9cec527d24 100644 --- a/src/v/kafka/server/BUILD +++ b/src/v/kafka/server/BUILD @@ -274,6 +274,7 @@ redpanda_cc_library( "//src/v/ssx:sharded_ptr", "//src/v/ssx:sharded_value", "//src/v/ssx:thread_worker", + "//src/v/ssx:when_all", "//src/v/storage", "//src/v/storage:parser_utils", "//src/v/storage:record_batch_builder", diff --git a/src/v/kafka/server/handlers/list_offsets.cc b/src/v/kafka/server/handlers/list_offsets.cc index b301e60a928a5..5363c2c1f7d66 100644 --- a/src/v/kafka/server/handlers/list_offsets.cc +++ b/src/v/kafka/server/handlers/list_offsets.cc @@ -23,6 +23,7 @@ #include "model/fundamental.h" #include "model/namespace.h" #include "resource_mgmt/io_priority.h" +#include "ssx/when_all.h" namespace kafka { @@ -193,7 +194,7 @@ static ss::future list_offsets_partition( static ss::future list_offsets_topic(list_offsets_ctx& octx, list_offset_topic& topic) { - std::vector> partitions; + chunked_vector> partitions; partitions.reserve(topic.partitions.size()); const auto* disabled_set @@ -232,9 +233,11 @@ list_offsets_topic(list_offsets_ctx& octx, list_offset_topic& topic) { partitions.push_back(std::move(pr)); } - return when_all_succeed(partitions.begin(), partitions.end()) + return ssx::when_all_succeed< + chunked_vector>( + std::move(partitions)) .then([name = std::move(topic.name)]( - std::vector parts) mutable { + chunked_vector parts) mutable { return list_offset_topic_response{ .name = std::move(name), .partitions = chunked_vector{ @@ -341,8 +344,9 @@ list_offsets_handler::handle(request_context ctx, ss::smp_service_group ssg) { return ss::do_with(std::move(octx), [](list_offsets_ctx& octx) { auto topics = list_offsets_topics(octx); - return ss::when_all_succeed(topics.begin(), topics.end()) - .then([&octx](std::vector topics) { + return ssx::when_all_succeed< + chunked_vector>(std::move(topics)) + .then([&octx](chunked_vector topics) { octx.response.data.topics = { std::make_move_iterator(topics.begin()), std::make_move_iterator(topics.end())};