chia7712 commented on code in PR #24034:
URL: https://github.com/apache/kafka/pull/24034#discussion_r4587687011


##########
metadata/src/main/java/org/apache/kafka/controller/PartitionChangeBuilder.java:
##########
@@ -177,6 +180,18 @@ public PartitionChangeBuilder 
setTargetLeaderRecoveryState(LeaderRecoveryState t
         return this;
     }
 
+    /**
+     * Set the minimum new leader epoch. A lower target has no effect, so the 
leader epoch never decreases.
+     */
+    public PartitionChangeBuilder setTargetLeaderEpoch(int targetLeaderEpoch) {
+        if (!metadataVersion.isClusterMirroringSupported()) {

Review Comment:
   I'd prefer using `metadataVersion.partitionChangeRecordVersion() >= 3`, 
since the check is
   really about the "leader epoch" field. Same for `maybeSetLeaderEpoch`.



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