hachikuji commented on a change in pull request #9202: URL: https://github.com/apache/kafka/pull/9202#discussion_r492203555
########## File path: core/src/main/scala/kafka/coordinator/group/GroupMetadataManager.scala ########## @@ -1402,23 +1403,18 @@ object GroupMetadataManager { val valueSchema = schemaForGroupValue(version) val value = valueSchema.read(buffer) - if (version >= 0 && version <= 3) { + if (version >= 0 && version <= CURRENT_GROUP_METADATA_VALUE_SCHEMA_VERSION) { val generationId = value.get(GENERATION_KEY).asInstanceOf[Int] val protocolType = value.get(PROTOCOL_TYPE_KEY).asInstanceOf[String] val protocol = value.get(PROTOCOL_KEY).asInstanceOf[String] val leaderId = value.get(LEADER_KEY).asInstanceOf[String] val memberMetadataArray = value.getArray(MEMBERS_KEY) val initialState = if (memberMetadataArray.isEmpty) Empty else Stable - val currentStateTimestamp: Option[Long] = version match { - case version if version == 2 => - if (value.hasField(CURRENT_STATE_TIMESTAMP_KEY)) { - val timestamp = value.getLong(CURRENT_STATE_TIMESTAMP_KEY) - if (timestamp == -1) None else Some(timestamp) - } else - None - case _ => - None - } + val currentStateTimestamp: Option[Long] = + if (version >= 2 && value.hasField(CURRENT_STATE_TIMESTAMP_KEY)) { Review comment: No strong opinion. I'm ok leaving the check. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org