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/14 07:28:33 UTC

[GitHub] [kafka] cmccabe opened a new pull request #10867: KAFKA-12931: KIP-746: Revise KRaft Metadata Records

cmccabe opened a new pull request #10867:
URL: https://github.com/apache/kafka/pull/10867


   Implement the metadata records changes described in KIP-746.


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



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

Posted by GitBox <gi...@apache.org>.
cmccabe commented on a change in pull request #10867:
URL: https://github.com/apache/kafka/pull/10867#discussion_r652002022



##########
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:
       Only the controller decides when brokers can be unfenced.




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



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

Posted by GitBox <gi...@apache.org>.
cmccabe commented on pull request #10867:
URL: https://github.com/apache/kafka/pull/10867#issuecomment-861030196


   Test failure is `org.apache.kafka.streams.integration.TaskMetadataIntegrationTest`, which is not related


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



[GitHub] [kafka] cmccabe merged pull request #10867: KAFKA-12931: KIP-746: Revise KRaft Metadata Records

Posted by GitBox <gi...@apache.org>.
cmccabe merged pull request #10867:
URL: https://github.com/apache/kafka/pull/10867


   


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



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

Posted by GitBox <gi...@apache.org>.
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