You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Hangleton (via GitHub)" <gi...@apache.org> on 2023/04/17 08:16:48 UTC

[GitHub] [kafka] Hangleton commented on a diff in pull request #13511: KAFKA-14869: Ignore unknown record types for coordinators (KIP-915, Part-1)

Hangleton commented on code in PR #13511:
URL: https://github.com/apache/kafka/pull/13511#discussion_r1168339962


##########
core/src/test/scala/unit/kafka/coordinator/group/GroupMetadataManagerTest.scala:
##########
@@ -640,8 +640,14 @@ class GroupMetadataManagerTest {
     val offsetCommitRecords = createCommittedOffsetRecords(committedOffsets)
     val memberId = "98098230493"
     val groupMetadataRecord = buildStableGroupRecordWithMember(generation, protocolType, protocol, memberId)
+
+    // Should ignore unknown record
+    val unknownKey = new org.apache.kafka.coordinator.group.generated.GroupMetadataKey()
+    val unknownMessage = MessageUtil.toVersionPrefixedBytes(Short.MaxValue, unknownKey)
+    val unknownRecord = new SimpleRecord(unknownMessage, unknownMessage)
+
     val records = MemoryRecords.withRecords(startOffset, CompressionType.NONE,
-      (offsetCommitRecords ++ Seq(groupMetadataRecord)).toArray: _*)
+      (offsetCommitRecords ++ Seq(unknownRecord) ++ Seq(groupMetadataRecord)).toArray: _*)

Review Comment:
   Nit: maybe we could have a test with a few more unknown records in the list with different version.



-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org