Skip to content

Commit

Permalink
KIP-516: CreateTopics and DeleteTopics bump (breaking protocol changes)
Browse files Browse the repository at this point in the history
Breaking:
- a string is converted to a nullable string in DeleteTopicsResponse
- Topics is changed to TopicNames in DeleteTopicsRequest, so that Topics
  itself can be used for a new struct that contains both the name and ID
  • Loading branch information
twmb committed Jan 31, 2021
1 parent b50282e commit 368bb21
Show file tree
Hide file tree
Showing 4 changed files with 179 additions and 21 deletions.
4 changes: 3 additions & 1 deletion generate/definitions/19_create_topics
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// creation defaults. See KIP-464.
//
// Version 5, also in 2.4.0, returns topic configs in the response (KIP-525).
CreateTopicsRequest => key 19, max version 6, flexible v5+, admin
CreateTopicsRequest => key 19, max version 7, flexible v5+, admin
// Topics is an array of topics to attempt to create.
Topics: [=>]
// Topic is a topic to create.
Expand Down Expand Up @@ -45,6 +45,8 @@ CreateTopicsResponse =>
Topics: [=>]
// Topic is the topic this response corresponds to.
Topic: string
// The unique topic ID.
TopicID: uuid // v7+
// ErrorCode is the error code for an individual topic creation.
//
// NOT_CONTROLLER is returned if the request was not issued to a Kafka
Expand Down
18 changes: 15 additions & 3 deletions generate/definitions/20_delete_topics
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
// DeleteTopicsRequest deletes Kafka topics.
DeleteTopicsRequest => key 20, max version 5, flexible v4+, admin
DeleteTopicsRequest => key 20, max version 6, flexible v4+, admin
// Topics is an array of topics to delete.
Topics: [string]
TopicNames: [string] // v0-v5
// The name or topic ID of topics to delete.
Topics: [=>] // v6+
Topic: nullable-string
TopicID: uuid
// TimeoutMillis is the millisecond timeout of this request.
TimeoutMillis: int32

Expand All @@ -13,7 +17,9 @@ DeleteTopicsResponse =>
// Topics contains responses for each topic requested for deletion.
Topics: [=>]
// Topic is the topic requested for deletion.
Topic: string
Topic: nullable-string-v6+
// The topic ID requested for deletion.
TopicID: uuid // v6+
// ErrorCode is the error code returned for an individual topic in
// deletion request.
//
Expand All @@ -30,6 +36,12 @@ DeleteTopicsResponse =>
// and brokers >= 2.1.0. INVALID_REQUEST is issued for request versions
// 0-2 against brokers >= 2.1.0. Otherwise, the request hangs until it
// times out.
//
// UNSUPPORTED_VERSION is returned when using topic IDs with a cluster
// that is not yet Kafka v2.8+.
//
// UNKNOWN_TOPIC_ID is returned when using topic IDs to a Kafka cluster
// v2.8+ and the topic ID is not found.
ErrorCode: int16
// ErrorMessage is a message for an error.
ErrorMessage: nullable-string // v5+
174 changes: 157 additions & 17 deletions pkg/kmsg/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions pkg/kversion/kversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -683,5 +683,9 @@ var maxTip = nextMax(max270, func(v []int16) []int16 {
// KAFKA-12212 7a1d1d9a69a241efd68e572badee999229b3942f KIP-700
v[4]++ // 11 metadata

// KAFKA-10764 4f588f7ca2a1c5e8dd845863da81425ac69bac92 KIP-516
v[19]++ // 7 create topics
v[20]++ // 6 delete topics

return v
})

0 comments on commit 368bb21

Please sign in to comment.