AndrewJSchofield commented on code in PR #16516:
URL: https://github.com/apache/kafka/pull/16516#discussion_r1664357349


##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/CoordinatorRecordHelpers.java:
##########
@@ -209,14 +211,40 @@ public static CoordinatorRecord newGroupEpochRecord(
     public static CoordinatorRecord newGroupEpochTombstoneRecord(
         String groupId
     ) {
-        return new CoordinatorRecord(
-            new ApiMessageAndVersion(
-                new ConsumerGroupMetadataKey()
-                    .setGroupId(groupId),
-                (short) 3
-            ),
-            null // Tombstone.
-        );
+        return newGroupEpochTombstoneRecord(groupId, GroupType.CONSUMER);
+    }
+
+    /**
+     * Creates a ConsumerGroupMetadata tombstone.
+     *
+     * @param groupId   The consumer group id.
+     * @param groupType The group type.
+     * @return The record.
+     */
+    public static CoordinatorRecord newGroupEpochTombstoneRecord(
+        String groupId,
+        GroupType groupType
+    ) {
+        if (groupType == GroupType.CONSUMER) {
+            return new CoordinatorRecord(
+                new ApiMessageAndVersion(
+                    new ConsumerGroupMetadataKey()
+                        .setGroupId(groupId),
+                    (short) 3
+                ),
+                null // Tombstone.
+            );
+        } else if (groupType == GroupType.SHARE) {
+            return new CoordinatorRecord(
+                new ApiMessageAndVersion(
+                    new ShareGroupMetadataKey()
+                        .setGroupId(groupId),
+                    (short) 3

Review Comment:
   This should be 11.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to