ahuang98 commented on code in PR #19416:
URL: https://github.com/apache/kafka/pull/19416#discussion_r2051130230


##########
raft/src/main/java/org/apache/kafka/raft/KafkaRaftClient.java:
##########
@@ -3621,7 +3646,35 @@ public long logEndOffset() {
 
     @Override
     public KRaftVersion kraftVersion() {
-        return partitionState.lastKraftVersion();
+        if (!isInitialized()) {
+            throw new IllegalStateException("Cannot read the kraft version 
before the replica has been initialized");
+        }
+
+        return quorum
+            .maybeLeaderState()
+            .flatMap(LeaderState::requestedKRaftVersion)

Review Comment:
   I see, would it be too complicated to un-entangle this from the kraftVersion 
that we return on a describeFeatures admin call? 
   e.g. have registration logic rely on in-memory and possibly uncommitted 
kraft version while describeFeatures returns only committed kraft 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-unsubscr...@kafka.apache.org

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

Reply via email to