Skip to content

[CORE-9879] kafka: Support for metadata v12#26235

Closed
BenPope wants to merge 5 commits intoredpanda-data:devfrom
BenPope:CORE-9879/metadata_v12
Closed

[CORE-9879] kafka: Support for metadata v12#26235
BenPope wants to merge 5 commits intoredpanda-data:devfrom
BenPope:CORE-9879/metadata_v12

Conversation

@BenPope
Copy link
Copy Markdown
Member

@BenPope BenPope commented May 23, 2025

Add support for metadata v12

Backports Required

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v25.1.x
  • v24.3.x
  • v24.2.x

Release Notes

  • none

@BenPope BenPope marked this pull request as ready for review May 23, 2025 11:35
@BenPope BenPope self-assigned this May 23, 2025
@vbotbuildovich
Copy link
Copy Markdown
Collaborator

Retry command for Build#66372

please wait until all jobs are finished before running the slash command

/ci-repeat 1
tests/rptest/tests/tiered_storage_model_test.py::TieredStorageTest.test_tiered_storage@{"cloud_storage_type_and_url_style":[1,"path"],"test_case":{"name":"(TS_Read == True, TS_TxRangeMaterialized == True, SpilloverManifestUploaded == True)"}}
tests/rptest/tests/data_migrations_api_test.py::DataMigrationsApiTest.test_conflicting_names

@vbotbuildovich
Copy link
Copy Markdown
Collaborator

CI test results

test results on build#66372
test_class test_method test_arguments test_kind job_url test_status passed reason
CloudStorageChunkReadTest test_read_when_segment_size_smaller_than_chunk_size ducktape https://buildkite.com/redpanda/redpanda/builds/66372#0196fd4a-b4fd-4dd7-a07b-d001870e7b76 FLAKY 20/21 upstream reliability is '98.58657243816255'. current run reliability is '95.23809523809523'. drift is 3.34848 and the allowed drift is set to 50. The test should PASS
DataMigrationsApiTest test_conflicting_names ducktape https://buildkite.com/redpanda/redpanda/builds/66372#0196fd4a-b4fe-4466-b494-df8b1cf6d9f4 FLAKY 4/21 upstream reliability is '100.0'. current run reliability is '19.047619047619047'. drift is 80.95238 and the allowed drift is set to 50. The test should FAIL
DatalakeDelayedEnablementTest test_enabling_iceberg_in_existing_cluster {"catalog_type": "rest_jdbc", "cloud_storage_type": 1} ducktape https://buildkite.com/redpanda/redpanda/builds/66372#0196fd91-d205-468c-868e-12b25f89b259 FLAKY 19/21 upstream reliability is '93.02325581395348'. current run reliability is '90.47619047619048'. drift is 2.54707 and the allowed drift is set to 50. The test should PASS
DeleteRecordsTest test_delete_records_topic_policy_change {"cloud_storage_enabled": true} ducktape https://buildkite.com/redpanda/redpanda/builds/66372#0196fd4a-b4ff-4ffc-8039-0f50ec1b938c FLAKY 20/21 upstream reliability is '99.25650557620817'. current run reliability is '95.23809523809523'. drift is 4.01841 and the allowed drift is set to 50. The test should PASS
PartitionBalancerTest test_recovery_mode_rebalance_finish ducktape https://buildkite.com/redpanda/redpanda/builds/66372#0196fd91-d203-40b9-b807-5f83127681f7 FLAKY 17/21 upstream reliability is '100.0'. current run reliability is '80.95238095238095'. drift is 19.04762 and the allowed drift is set to 50. The test should PASS
RandomNodeOperationsTest test_node_operations {"cloud_storage_type": 1, "enable_failures": false, "mixed_versions": false, "with_chunked_compaction": false, "with_iceberg": false} ducktape https://buildkite.com/redpanda/redpanda/builds/66372#0196fd91-d204-41cb-9b36-322a92404564 FLAKY 20/21 upstream reliability is '82.63157894736842'. current run reliability is '95.23809523809523'. drift is -12.60652 and the allowed drift is set to 50. The test should PASS
RandomNodeOperationsTest test_node_operations {"cloud_storage_type": 1, "enable_failures": false, "mixed_versions": false, "with_chunked_compaction": false, "with_iceberg": true} ducktape https://buildkite.com/redpanda/redpanda/builds/66372#0196fd91-d204-41cb-9b36-322a92404564 FLAKY 20/21 upstream reliability is '95.04950495049505'. current run reliability is '95.23809523809523'. drift is -0.18859 and the allowed drift is set to 50. The test should PASS
TieredStorageTest test_tiered_storage {"cloud_storage_type_and_url_style": [1, "path"], "test_case": {"name": "(TS_Read == True, TS_TxRangeMaterialized == True, SpilloverManifestUploaded == True)"}} ducktape https://buildkite.com/redpanda/redpanda/builds/66372#0196fd4a-b4fe-4466-b494-df8b1cf6d9f4 FAIL 0/1 The test has failed across all retries

@michael-redpanda michael-redpanda marked this pull request as draft June 2, 2025 18:25
@pgellert pgellert removed their request for review June 9, 2025 15:23
@BenPope BenPope requested a review from IoannisRP July 18, 2025 20:37
Signed-off-by: Ben Pope <ben@redpanda.com>
@BenPope BenPope force-pushed the CORE-9879/metadata_v12 branch from a4bd672 to f282865 Compare July 18, 2025 21:06
BenPope added 4 commits July 18, 2025 22:14
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>
@BenPope BenPope force-pushed the CORE-9879/metadata_v12 branch from f282865 to d2f616e Compare July 18, 2025 21:15
@BenPope
Copy link
Copy Markdown
Member Author

BenPope commented Jul 18, 2025

Changes in force-push

  • Rebase

Changes in force-push

  • Add unknown_topic_id to retriable errors

@pgellert pgellert self-requested a review July 21, 2025 09:52
Comment on lines 99 to +102
class uuid {
public:
static constexpr auto length = 16;
using underlying_t = std::array<uint8_t, length>;
using underlying_t = uuid_t;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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).

Comment on lines +320 to +324
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{}) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

repeated use of use_topic_ids && topic.topic_id != uuid{}. Better to extract it to a named variable

Comment on lines +364 to +372
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));
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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?

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

Comment on lines +354 to +356
auto topic_id = get_topic_id(test_topic_name);
BOOST_REQUIRE(topic_id.has_value());
BOOST_REQUIRE_NE(topic_id.value(), model::topic_id{});
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

does this needs to be inside the loop?

.get();
BOOST_REQUIRE(!create_resp.data.errored());

const kafka::metadata_response_data default_response;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

unused variable?

Comment on lines +479 to +480
.topics
= {{{.name{ssx::sformat("{}_{}_{}", test_topic_create, "by_name", ver)}}, {.name{test_topic_query}}}},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit:

Suggested change
.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.

Comment on lines +498 to +499
.topics
= {{{.name{ssx::sformat("{}_{}_{}", test_topic_create, "by_id", ver)}}, {.topic_id{kafka::uuid{*query_topic_id}}}}},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same as above


@cluster(num_nodes=3, log_allow_list=TX_ERROR_LOGS)
@matrix(version=["2.1.0"])
@matrix(version=["2.1.0", "2.6.0"])
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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?

@BenPope
Copy link
Copy Markdown
Member Author

BenPope commented Jul 28, 2025

Moving to closed, in favour of #26968

@BenPope BenPope closed this Jul 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants