CalvinConfluent commented on code in PR #14706:
URL: https://github.com/apache/kafka/pull/14706#discussion_r1399575912


##########
metadata/src/main/java/org/apache/kafka/controller/ReplicationControlManager.java:
##########
@@ -1294,8 +1315,11 @@ void handleBrokerFenced(int brokerId, 
List<ApiMessageAndVersion> records) {
      */
     void handleBrokerUnregistered(int brokerId, long brokerEpoch,
                                   List<ApiMessageAndVersion> records) {
-        generateLeaderAndIsrUpdates("handleBrokerUnregistered", brokerId, 
NO_LEADER, records,
-            brokersToIsrs.partitionsWithBrokerInIsr(brokerId));
+        generateLeaderAndIsrUpdates("handleBrokerUnregistered", brokerId, 
NO_LEADER, NO_LEADER, records,
+            new PartitionsOnReplicaIteratorChain(Arrays.asList(

Review Comment:
   Removed.



##########
metadata/src/main/java/org/apache/kafka/controller/PartitionChangeBuilder.java:
##########
@@ -466,6 +466,10 @@ private void 
maybeUpdateLastKnownLeader(PartitionChangeRecord record) {
             partition.lastKnownElr[0] != partition.leader)) {
             // Only update the last known leader when the first time the 
partition becomes leaderless.
             record.setLastKnownELR(Arrays.asList(partition.leader));
+        } else if ((record.leader() != NO_LEADER && record.leader() != 
NO_LEADER_CHANGE || partition.leader != NO_LEADER)

Review Comment:
   Done.



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