[GitHub] [kafka] jsancio commented on a change in pull request #11159: MINOR: Change default node id in kraft broker properties

2021-08-05 Thread GitBox


jsancio commented on a change in pull request #11159:
URL: https://github.com/apache/kafka/pull/11159#discussion_r682775395



##
File path: core/src/main/scala/kafka/server/ControllerApis.scala
##
@@ -552,7 +552,10 @@ class ControllerApis(val requestChannel: RequestChannel,
   def handleBrokerRegistration(request: RequestChannel.Request): Unit = {
 val registrationRequest = request.body[BrokerRegistrationRequest]
 authHelper.authorizeClusterOperation(request, CLUSTER_ACTION)
-
+val controllerNode = controllerNodes.find(node => node.id == 
registrationRequest.brokerId)
+if (controllerNode.isDefined) {
+  info(s"A broker is registering with 
${KafkaConfig.NodeIdProp}=${controllerNode.get.id} which is also in use by a 
controller.")
+}

Review comment:
   I would remove this log message. This is a valid configuration and I 
don't think it is providing any additional information.

##
File path: 
clients/src/main/java/org/apache/kafka/common/requests/BrokerRegistrationRequest.java
##
@@ -57,6 +57,10 @@ public BrokerRegistrationRequestData data() {
 return data;
 }
 
+public int brokerId() {
+return data.brokerId();
+}
+

Review comment:
   I think this pattern undermines the advantages of the message JSON 
schema and the Java code generated from it.




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




[GitHub] [kafka] jsancio commented on a change in pull request #11159: MINOR: Change default node id in kraft broker properties

2021-08-04 Thread GitBox


jsancio commented on a change in pull request #11159:
URL: https://github.com/apache/kafka/pull/11159#discussion_r682775395



##
File path: core/src/main/scala/kafka/server/ControllerApis.scala
##
@@ -552,7 +552,10 @@ class ControllerApis(val requestChannel: RequestChannel,
   def handleBrokerRegistration(request: RequestChannel.Request): Unit = {
 val registrationRequest = request.body[BrokerRegistrationRequest]
 authHelper.authorizeClusterOperation(request, CLUSTER_ACTION)
-
+val controllerNode = controllerNodes.find(node => node.id == 
registrationRequest.brokerId)
+if (controllerNode.isDefined) {
+  info(s"A broker is registering with 
${KafkaConfig.NodeIdProp}=${controllerNode.get.id} which is also in use by a 
controller.")
+}

Review comment:
   I would remove this log message. This is a valid configuration and I 
don't think it is providing any additional information.

##
File path: 
clients/src/main/java/org/apache/kafka/common/requests/BrokerRegistrationRequest.java
##
@@ -57,6 +57,10 @@ public BrokerRegistrationRequestData data() {
 return data;
 }
 
+public int brokerId() {
+return data.brokerId();
+}
+

Review comment:
   I think this pattern undermines the advantages of the message JSON 
schema and the Java code generated from it.




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




[GitHub] [kafka] jsancio commented on a change in pull request #11159: MINOR: Change default node id in kraft broker properties

2021-08-02 Thread GitBox


jsancio commented on a change in pull request #11159:
URL: https://github.com/apache/kafka/pull/11159#discussion_r681283772



##
File path: 
metadata/src/main/java/org/apache/kafka/controller/ClusterControlManager.java
##
@@ -239,11 +239,11 @@ public void replay(RegisterBrokerRecord record) {
 features.put(feature.name(), new VersionRange(
 feature.minSupportedVersion(), feature.maxSupportedVersion()));
 }
+BrokerRegistration prevRegistration = 
brokerRegistrations.getOrDefault(brokerId, null);

Review comment:
   Yes, it looks like it affects the log message printed, right? It doesn't 
explain the behavior you are seeing.




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




[GitHub] [kafka] jsancio commented on a change in pull request #11159: MINOR: Change default node id in kraft broker properties

2021-08-02 Thread GitBox


jsancio commented on a change in pull request #11159:
URL: https://github.com/apache/kafka/pull/11159#discussion_r681159222



##
File path: 
metadata/src/main/java/org/apache/kafka/controller/ClusterControlManager.java
##
@@ -239,11 +239,11 @@ public void replay(RegisterBrokerRecord record) {
 features.put(feature.name(), new VersionRange(
 feature.minSupportedVersion(), feature.maxSupportedVersion()));
 }
+BrokerRegistration prevRegistration = 
brokerRegistrations.getOrDefault(brokerId, null);

Review comment:
   `Map::put` returns the previous value.




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