Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/v/kafka/client/errors.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ inline bool is_retriable_error(kafka::error_code ec) {
case error_code::duplicate_resource:
case error_code::unacceptable_credential:
case error_code::transactional_id_not_found:
case error_code::rebootstrap_required:
return false;
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/v/kafka/protocol/errors.cc
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ std::string_view error_code_to_str(error_code error) {
return "unknown_topic_id";
case error_code::transactional_id_not_found:
return "transactional_id_not_found";
case error_code::rebootstrap_required:
return "rebootstrap_required";
default:
return "unknown_error_code";
}
Expand Down Expand Up @@ -319,6 +321,7 @@ bool is_retriable(error_code error) {
case error_code::duplicate_resource:
case error_code::unacceptable_credential:
case error_code::transactional_id_not_found:
case error_code::rebootstrap_required:
break;
}
return false;
Expand Down
3 changes: 3 additions & 0 deletions src/v/kafka/protocol/errors.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,9 @@ enum class error_code : int16_t {
unknown_topic_id = 100,
// The transactional_id could not be found for describe tx request.
transactional_id_not_found = 105,
// Client metadata is stale; the client should rebootstrap to obtain new
// metadata. Introduced by KIP-1102.
rebootstrap_required = 129,
};

std::string_view error_code_to_str(error_code error);
Expand Down
2 changes: 1 addition & 1 deletion src/v/kafka/protocol/metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ struct metadata_request {

metadata_request copy() const {
static_assert(
api_type::max_valid == api_version(12),
api_type::max_valid == api_version(13),
"Please update the metadata_request::copy method when updating the "
"Metadata API");
return {
Expand Down
4 changes: 3 additions & 1 deletion src/v/kafka/protocol/schemata/metadata_request.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"type": "request",
"listeners": ["zkBroker", "broker"],
"name": "MetadataRequest",
"validVersions": "0-12",
"validVersions": "0-13",
"flexibleVersions": "9+",
"fields": [
// In version 0, an empty array indicates "request metadata for all topics." In version 1 and
Expand All @@ -39,6 +39,8 @@
// Version 11 deprecates IncludeClusterAuthorizedOperations field. This is now exposed
// by the DescribeCluster API (KIP-700).
// Version 12 supports topic Id.
//
// Version 13 has no request-side changes (top-level ErrorCode added to the response only, KIP-1102).
{ "name": "Topics", "type": "[]MetadataRequestTopic", "versions": "0+", "nullableVersions": "1+",
"about": "The topics to fetch metadata for.", "fields": [
{ "name": "TopicId", "type": "uuid", "versions": "10+", "ignorable": true, "about": "The topic id." },
Expand Down
8 changes: 6 additions & 2 deletions src/v/kafka/protocol/schemata/metadata_response.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@
// Version 11 deprecates ClusterAuthorizedOperations. This is now exposed
// by the DescribeCluster API (KIP-700).
// Version 12 supports topicId.
"validVersions": "0-12",
//
// Version 13 supports top-level error code in the response (KIP-1102).
"validVersions": "0-13",
"flexibleVersions": "9+",
"fields": [
{ "name": "ThrottleTimeMs", "type": "int32", "versions": "3+", "ignorable": true,
Expand Down Expand Up @@ -93,6 +95,8 @@
"about": "32-bit bitfield to represent authorized operations for this topic." }
]},
{ "name": "ClusterAuthorizedOperations", "type": "int32", "versions": "8-10", "default": "-2147483648",
"about": "32-bit bitfield to represent authorized operations for this cluster." }
"about": "32-bit bitfield to represent authorized operations for this cluster." },
{ "name": "ErrorCode", "type": "int16", "versions": "13+", "ignorable": true,
"about": "The top-level error code, or 0 if there was no error." }
]
}
2 changes: 1 addition & 1 deletion src/v/kafka/server/handlers/metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ memory_estimate_fn metadata_memory_estimator;
using metadata_handler = single_stage_handler<
metadata_api,
0,
12,
13,
metadata_memory_estimator,
default_scheduling_group_provider,
latency_hist::yes>;
Expand Down
1 change: 1 addition & 0 deletions src/v/pandaproxy/error.cc
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ std::error_condition make_error_condition(std::error_code ec) {
case kec::group_subscribed_to_topic:
case kec::unstable_offset_commit:
case kec::no_reassignment_in_progress:
case kec::rebootstrap_required:
return rec::kafka_error;
case kec::network_exception:
case kec::coordinator_load_in_progress:
Expand Down
2 changes: 1 addition & 1 deletion tests/docker/ducktape-deps/kcl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
set -e
go install github.com/twmb/kcl@v0.16.0
go install github.com/twmb/kcl@v0.18.0
mv /root/go/bin/kcl /usr/local/bin/
Loading
Loading