KAFKA-14048: Add new `__consumer_offsets` records from KIP-848 (#13203)

This patch adds the new (only the new ones) `__consumer_offsets` records as described in [KIP-848](https://cwiki.apache.org/confluence/display/KAFKA/KIP-848%3A+The+Next+Generation+of+the+Consumer+Rebalance+Protocol#KIP848:TheNextGenerationoftheConsumerRebalanceProtocol-Records).

Reviewers: Christo Lolov <lolovc@amazon.com>, Mickael Maison <mickael.maison@gmail.com>
This commit is contained in:
David Jacot 2023-02-09 09:10:28 +01:00 committed by GitHub
parent 087a5d8f4f
commit 659dd2e49f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 372 additions and 0 deletions

View File

@ -0,0 +1,28 @@
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to You under the Apache License, Version 2.0
// (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// KIP-848 is in development. This schema is subject to non-backwards-compatible changes.
{
"type": "data",
"name": "ConsumerGroupCurrentMemberAssignmentKey",
"validVersions": "8",
"flexibleVersions": "none",
"fields": [
{ "name": "GroupId", "type": "string", "versions": "8",
"about": "The group id." },
{ "name": "MemberId", "type": "string", "versions": "8",
"about": "The member id." }
]
}

View File

@ -0,0 +1,37 @@
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to You under the Apache License, Version 2.0
// (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// KIP-848 is in development. This schema is subject to non-backwards-compatible changes.
{
"type": "data",
"name": "ConsumerGroupCurrentMemberAssignmentValue",
"validVersions": "0",
"flexibleVersions": "0+",
"fields": [
{ "name": "MemberEpoch", "versions": "0+", "type": "int32",
"about": "The member epoch." },
{ "name": "Error", "versions": "0+", "type": "int8",
"about": "The error reported by the assignor." },
{ "name": "TopicPartitions", "versions": "0+", "type": "[]TopicPartition",
"about": "The partitions assigned to this member.", "fields": [
{ "name": "TopicId", "versions": "0+", "type": "uuid" },
{ "name": "Partitions", "versions": "0+", "type": "[]int32" }
]},
{ "name": "MetadataVersion", "versions": "0+", "type": "int16",
"about": "The version of the metadata bytes." },
{ "name": "MetadataBytes", "versions": "0+", "type": "bytes",
"about": "The metadata bytes." }
]
}

View File

@ -0,0 +1,28 @@
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to You under the Apache License, Version 2.0
// (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// KIP-848 is in development. This schema is subject to non-backwards-compatible changes.
{
"type": "data",
"name": "ConsumerGroupMemberMetadataKey",
"validVersions": "5",
"flexibleVersions": "none",
"fields": [
{ "name": "GroupId", "type": "string", "versions": "5",
"about": "The group id." },
{ "name": "MemberId", "type": "string", "versions": "5",
"about": "The member id." }
]
}

View File

@ -0,0 +1,53 @@
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to You under the Apache License, Version 2.0
// (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// KIP-848 is in development. This schema is subject to non-backwards-compatible changes.
{
"type": "data",
"name": "ConsumerGroupMemberMetadataValue",
"validVersions": "0",
"flexibleVersions": "0+",
"fields": [
{ "name": "GroupEpoch", "versions": "0+", "type": "int32",
"about": "The group epoch." },
{ "name": "InstanceId", "versions": "0+", "nullableVersions": "0+", "type": "string",
"about": "The (optional) instance id." },
{ "name": "RackId", "versions": "0+", "nullableVersions": "0+", "type": "string",
"about": "The (optional) rack id." },
{ "name": "ClientId", "versions": "0+", "type": "string",
"about": "The client id." },
{ "name": "ClientHost", "versions": "0+", "type": "string",
"about": "The client host." },
{ "name": "SubscribedTopicNames", "versions": "0+", "type": "[]string",
"about": "The list of subscribed topic names." },
{ "name": "SubscribedTopicRegex", "versions": "0+", "nullableVersions": "0+", "type": "string",
"about": "The subscribed topic regular expression." },
{ "name": "Assignors", "versions": "0+", "type": "[]Assignor",
"about": "The list of assignors.", "fields": [
{ "name": "Name", "versions": "0+", "type": "string",
"about": "The assignor name." },
{ "name": "MinimumVersion", "versions": "0+", "type": "int16",
"about": "The minimum version supported by the assignor." },
{ "name": "MaximumVersion", "versions": "0+", "type": "int16",
"about": "The maximum version supported by the assignor." },
{ "name": "Reason", "versions": "0+", "type": "int8",
"about": "The reason reported by the assignor." },
{ "name": "Version", "versions": "0+", "type": "int16",
"about": "The version used to serialize the metadata." },
{ "name": "Metadata", "versions": "0+", "type": "bytes",
"about": "The metadata." }
]}
]
}

View File

@ -0,0 +1,26 @@
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to You under the Apache License, Version 2.0
// (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// KIP-848 is in development. This schema is subject to non-backwards-compatible changes.
{
"type": "data",
"name": "ConsumerGroupMetadataKey",
"validVersions": "3",
"flexibleVersions": "none",
"fields": [
{ "name": "GroupId", "type": "string", "versions": "3",
"about": "The group id." }
]
}

View File

@ -0,0 +1,26 @@
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to You under the Apache License, Version 2.0
// (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// KIP-848 is in development. This schema is subject to non-backwards-compatible changes.
{
"type": "data",
"name": "ConsumerGroupMetadataValue",
"validVersions": "0",
"flexibleVersions": "0+",
"fields": [
{ "name": "Epoch", "versions": "0+", "type": "int32",
"about": "The group epoch." }
]
}

View File

@ -0,0 +1,26 @@
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to You under the Apache License, Version 2.0
// (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// KIP-848 is in development. This schema is subject to non-backwards-compatible changes.
{
"type": "data",
"name": "ConsumerGroupPartitionMetadataKey",
"validVersions": "4",
"flexibleVersions": "none",
"fields": [
{ "name": "GroupId", "type": "string", "versions": "4",
"about": "The group id." }
]
}

View File

@ -0,0 +1,33 @@
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to You under the Apache License, Version 2.0
// (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// KIP-848 is in development. This schema is subject to non-backwards-compatible changes.
{
"type": "data",
"name": "ConsumerGroupPartitionMetadataValue",
"validVersions": "0",
"flexibleVersions": "0+",
"fields": [
{ "name": "Epoch", "versions": "0+", "type": "int32",
"about": "The group epoch." },
{ "name": "Topics", "versions": "0+", "type": "[]TopicMetadata",
"about": "The list of topic metadata.", "fields": [
{ "name": "TopicId", "versions": "0+", "type": "uuid",
"about": "The topic id." },
{ "name": "NumPartitions", "versions": "0+", "type": "int32",
"about": "The number of partitions of the topic." }
]}
]
}

View File

@ -0,0 +1,28 @@
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to You under the Apache License, Version 2.0
// (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// KIP-848 is in development. This schema is subject to non-backwards-compatible changes.
{
"type": "data",
"name": "ConsumerGroupTargetAssignmentMemberKey",
"validVersions": "7",
"flexibleVersions": "none",
"fields": [
{ "name": "GroupId", "type": "string", "versions": "7",
"about": "The group id." },
{ "name": "MemberId", "type": "string", "versions": "7",
"about": "The member id." }
]
}

View File

@ -0,0 +1,35 @@
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to You under the Apache License, Version 2.0
// (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// KIP-848 is in development. This schema is subject to non-backwards-compatible changes.
{
"type": "data",
"name": "ConsumerGroupTargetAssignmentMemberValue",
"validVersions": "0",
"flexibleVersions": "0+",
"fields": [
{ "name": "Error", "versions": "0+", "type": "int8",
"about": "The assigned error."},
{ "name": "TopicPartitions", "versions": "0+", "type": "[]TopicPartition",
"about": "The assigned partitions.", "fields": [
{ "name": "TopicId", "versions": "0+", "type": "uuid" },
{ "name": "Partitions", "versions": "0+", "type": "[]int32" }
]},
{ "name": "MetadataVersion", "versions": "0+", "type": "int16",
"about": "The version of the assigned metadata." },
{ "name": "MetadataBytes", "versions": "0+", "type": "bytes",
"about": "The assigned metadata." }
]
}

View File

@ -0,0 +1,26 @@
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to You under the Apache License, Version 2.0
// (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// KIP-848 is in development. This schema is subject to non-backwards-compatible changes.
{
"type": "data",
"name": "ConsumerGroupTargetAssignmentMetadataKey",
"validVersions": "6",
"flexibleVersions": "none",
"fields": [
{ "name": "GroupId", "type": "string", "versions": "6",
"about": "The group id." }
]
}

View File

@ -0,0 +1,26 @@
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to You under the Apache License, Version 2.0
// (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// KIP-848 is in development. This schema is subject to non-backwards-compatible changes.
{
"type": "data",
"name": "ConsumerGroupTargetAssignmentMetadataValue",
"validVersions": "0",
"flexibleVersions": "0+",
"fields": [
{ "name": "AssignmentEpoch", "versions": "0+", "type": "int32",
"about": "The assignment epoch." }
]
}