ijuma commented on a change in pull request #10675:
URL: https://github.com/apache/kafka/pull/10675#discussion_r630612053



##########
File path: 
clients/src/main/java/org/apache/kafka/common/requests/TxnOffsetCommitRequest.java
##########
@@ -88,26 +84,13 @@ public Builder(final String transactionalId,
                             .setMemberId(memberId)
                             .setGenerationId(generationId)
                             .setGroupInstanceId(groupInstanceId.orElse(null));
-            this.autoDowngrade = autoDowngrade;
         }
 
         @Override
         public TxnOffsetCommitRequest build(short version) {
             if (version < 3 && groupMetadataSet()) {
-                if (autoDowngrade) {
-                    log.trace("Downgrade the request by resetting group 
metadata fields: " +
-                                  "[member.id:{}, generation.id:{}, 
group.instance.id:{}], because broker " +
-                                  "only supports TxnOffsetCommit version {}. 
Need " +
-                                  "v3 or newer to enable this feature",
-                        data.memberId(), data.generationId(), 
data.groupInstanceId(), version);
-
-                    
data.setGenerationId(JoinGroupRequest.UNKNOWN_GENERATION_ID)
-                        .setMemberId(JoinGroupRequest.UNKNOWN_MEMBER_ID)
-                        .setGroupInstanceId(null);
-                } else {
-                    throw new UnsupportedVersionException("Broker unexpectedly 
" +
+                throw new UnsupportedVersionException("Broker unexpectedly " +

Review comment:
       I think we can improve this message a little:
   1. Remove `unexpectedly` since it doesn't add much value and it's a bit 
confusing (it makes it sound like there's a broker bug)
   2. Include the minimum version required (`3`) in the message.




-- 
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


Reply via email to