You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/06/15 17:19:19 UTC

[GitHub] [kafka] mumrah commented on a change in pull request #10867: KAFKA-12931: KIP-746: Revise KRaft Metadata Records

mumrah commented on a change in pull request #10867:
URL: https://github.com/apache/kafka/pull/10867#discussion_r651991734



##########
File path: metadata/src/main/java/org/apache/kafka/controller/ClusterControlManager.java
##########
@@ -236,20 +239,11 @@ public void replay(RegisterBrokerRecord record) {
             features.put(feature.name(), new VersionRange(
                 feature.minSupportedVersion(), feature.maxSupportedVersion()));
         }
-        // Normally, all newly registered brokers start off in the fenced state.
-        // If this registration record is for a broker incarnation that was already
-        // registered, though, we preserve the existing fencing state.
-        boolean fenced = true;
-        BrokerRegistration prevRegistration = brokerRegistrations.get(brokerId);
-        if (prevRegistration != null &&
-                prevRegistration.incarnationId().equals(record.incarnationId())) {
-            fenced = prevRegistration.fenced();
-        }
         // Update broker registrations.
         brokerRegistrations.put(brokerId, new BrokerRegistration(brokerId,
             record.brokerEpoch(), record.incarnationId(), listeners, features,
-            Optional.ofNullable(record.rack()), fenced));
-
+            Optional.ofNullable(record.rack()), record.fenced()));
+        BrokerRegistration prevRegistration = brokerRegistrations.get(brokerId);

Review comment:
       Since we are adding `fenced` to the RegisterBrokerRecord, do we also need to add a `fenced` field to the BrokerRegistrationRequest RPC? Or is it the case that only the controller will set the fenced state of this record




-- 
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:
users@infra.apache.org