[CORE-9879] kafka: Support for metadata v12#26235
[CORE-9879] kafka: Support for metadata v12#26235BenPope wants to merge 5 commits intoredpanda-data:devfrom
Conversation
Retry command for Build#66372please wait until all jobs are finished before running the slash command |
CI test resultstest results on build#66372
|
Signed-off-by: Ben Pope <ben@redpanda.com>
a4bd672 to
f282865
Compare
Signed-off-by: Ben Pope <ben@redpanda.com>
Signed-off-by: Ben Pope <ben@redpanda.com>
Signed-off-by: Ben Pope <ben@redpanda.com>
Add back testing that was previously removed. Signed-off-by: Ben Pope <ben@redpanda.com>
f282865 to
d2f616e
Compare
|
Changes in force-push
Changes in force-push
|
| class uuid { | ||
| public: | ||
| static constexpr auto length = 16; | ||
| using underlying_t = std::array<uint8_t, length>; | ||
| using underlying_t = uuid_t; |
There was a problem hiding this comment.
Is it for historic reasons that we have both kafka::uuid and uuid_t types? or is there a reason to redefine the type here? The only difference i see is that there are no non-const accessors.
Either way, length can be removed (or be defined in terms of uuid_t::length).
| const bool should_describe | ||
| = (!use_topic_ids && topic.name.has_value()) | ||
| || (use_topic_ids && topic.topic_id != uuid{}); | ||
|
|
||
| if (use_topic_ids && topic.topic_id != uuid{}) { |
There was a problem hiding this comment.
repeated use of use_topic_ids && topic.topic_id != uuid{}. Better to extract it to a named variable
| if (!use_topic_ids) { | ||
| bool valid = topic.name.has_value() | ||
| && validate_kafka_topic_name(*topic.name) | ||
| == model::errc::success; | ||
| res.push_back(make_error_topic_response( | ||
| move_topic_name(), | ||
| valid ? error_code::unknown_topic_or_partition | ||
| : error_code::invalid_topic_exception)); | ||
| } |
There was a problem hiding this comment.
previously, this conditional would always push back to res. Now we push back to res only if !use_topic_ids, but we continue, regardless.
Is this the desired behavior?
There was a problem hiding this comment.
previously, this conditional would always push back to
res. Now we push back toresonly if!use_topic_ids, but wecontinue, regardless.Is this the desired behavior?
It might be useful to more closely model the code layout in kafka, but yes: https://github.com/apache/kafka/blob/4.0.0/core/src/main/scala/kafka/server/KafkaApis.scala#L860-L861
| auto topic_id = get_topic_id(test_topic_name); | ||
| BOOST_REQUIRE(topic_id.has_value()); | ||
| BOOST_REQUIRE_NE(topic_id.value(), model::topic_id{}); |
There was a problem hiding this comment.
does this needs to be inside the loop?
| .get(); | ||
| BOOST_REQUIRE(!create_resp.data.errored()); | ||
|
|
||
| const kafka::metadata_response_data default_response; |
| .topics | ||
| = {{{.name{ssx::sformat("{}_{}_{}", test_topic_create, "by_name", ver)}}, {.name{test_topic_query}}}}, |
There was a problem hiding this comment.
nit:
| .topics | |
| = {{{.name{ssx::sformat("{}_{}_{}", test_topic_create, "by_name", ver)}}, {.name{test_topic_query}}}}, | |
| .topics{ | |
| {{.name{ | |
| ssx::sformat("{}_{}_{}", test_topic_create, "by_name", ver)}}, | |
| {.name{test_topic_query}}}}, |
Removing the = produces much more readable formating.
The rest of the values (bools) give a warning without the =, so i say mix them.
| .topics | ||
| = {{{.name{ssx::sformat("{}_{}_{}", test_topic_create, "by_id", ver)}}, {.topic_id{kafka::uuid{*query_topic_id}}}}}, |
|
|
||
| @cluster(num_nodes=3, log_allow_list=TX_ERROR_LOGS) | ||
| @matrix(version=["2.1.0"]) | ||
| @matrix(version=["2.1.0", "2.6.0"]) |
There was a problem hiding this comment.
Previously we had these with metadata v11. Now they are added back together with v12.
Would it be possible to add a comment on the commit as to what requirements it has/how it is connected to the rest of the changes?
|
Moving to closed, in favour of #26968 |
Add support for metadata v12
Backports Required
Release Notes