apalan60 commented on code in PR #20338:
URL: https://github.com/apache/kafka/pull/20338#discussion_r2267616966


##########
core/src/test/scala/unit/kafka/server/BrokerRegistrationRequestTest.scala:
##########
@@ -154,13 +154,13 @@ class BrokerRegistrationRequestTest {
 
       // No features (MV) sent with registration, controller can't verify
       assertEquals(
-        Errors.BROKER_ID_NOT_REGISTERED,
-        registerBroker(channelManager, clusterId, 100, Some(1), None))
+        Errors.INVALID_REGISTRATION,
+        registerBroker(channelManager, clusterId, 100, None, None))
 
       // Given MV is too high for controller to support
       assertEquals(
-        Errors.BROKER_ID_NOT_REGISTERED,
-        registerBroker(channelManager, clusterId, 100, Some(1), 
Some((MetadataVersion.IBP_3_4_IV0.featureLevel, 
MetadataVersion.IBP_3_4_IV0.featureLevel))))
+        Errors.UNSUPPORTED_VERSION,
+        registerBroker(channelManager, clusterId, 100, None, 
Some((MetadataVersion.IBP_3_4_IV0.featureLevel, 
MetadataVersion.IBP_3_4_IV0.featureLevel))))

Review Comment:
   Previously, passing `Some(1)` as the `zkEpoch` parameter caused 
`zkEpoch.isDefined` to always be `true`, which led to a 
[BrokerIdNotRegisteredException](https://github.com/apache/kafka/blob/634e99e9ab16db61990f4922f0a30b6a93f27785/metadata/src/main/java/org/apache/kafka/controller/ClusterControlManager.java#L374C8-L376C10)
 being thrown.  
   As a result, the intended test scenario was never actually tested.
   



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