ijuma commented on code in PR #18468:
URL: https://github.com/apache/kafka/pull/18468#discussion_r1910362543
##########
core/src/main/scala/kafka/coordinator/group/GroupMetadataManager.scala:
##########
@@ -1085,17 +1084,14 @@ object GroupMetadataManager {
* Generates the payload for offset commit message from given offset and
metadata
*
* @param offsetAndMetadata consumer's current offset and metadata
- * @param metadataVersion the api version
+ * @param maxVersion the naxinu - // Serialize with the highest supported
non-flexible version
+ // until a tagged field is introduced or the version is bumped. FIXME
* @return payload for offset commit message
*/
- def offsetCommitValue(offsetAndMetadata: OffsetAndMetadata,
- metadataVersion: MetadataVersion): Array[Byte] = {
+ def offsetCommitValue(offsetAndMetadata: OffsetAndMetadata, maxVersion:
Short = 3): Array[Byte] = {
val version =
- if (metadataVersion.isLessThan(IBP_2_1_IV0) ||
offsetAndMetadata.expireTimestampMs.isPresent) 1.toShort
- else if (metadataVersion.isLessThan(IBP_2_1_IV1)) 2.toShort
- // Serialize with the highest supported non-flexible version
- // until a tagged field is introduced or the version is bumped.
- else 3.toShort
+ if (offsetAndMetadata.expireTimestampMs.isPresent) 1.toShort
+ else maxVersion
Review Comment:
This is needed for some tests that verify the ability to read messages
encoded with the old format. I'm not sure if there's a way to make sure there
are no messages written with the old format by the time the broker is upgraded
to 4.0. Given the usual retention rules, it should be fine, but not sure if we
can be sure. Thoughts?
--
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]