ijuma commented on code in PR #18465:
URL: https://github.com/apache/kafka/pull/18465#discussion_r1910472130
##########
core/src/main/scala/kafka/server/KafkaApis.scala:
##########
@@ -3483,19 +3456,7 @@ class KafkaApis(val requestChannel: RequestChannel,
}
def handleAllocateProducerIdsRequest(request: RequestChannel.Request): Unit
= {
- val zkSupport =
metadataSupport.requireZkOrThrow(KafkaApis.shouldNeverReceive(request))
- authHelper.authorizeClusterOperation(request, CLUSTER_ACTION)
-
- val allocateProducerIdsRequest = request.body[AllocateProducerIdsRequest]
-
- if (!zkSupport.controller.isActive)
- requestHelper.sendResponseMaybeThrottle(request, throttleTimeMs =>
- allocateProducerIdsRequest.getErrorResponse(throttleTimeMs,
Errors.NOT_CONTROLLER.exception))
- else
-
zkSupport.controller.allocateProducerIds(allocateProducerIdsRequest.data,
producerIdsResponse =>
- requestHelper.sendResponseMaybeThrottle(request, throttleTimeMs =>
- new
AllocateProducerIdsResponse(producerIdsResponse.setThrottleTimeMs(throttleTimeMs)))
- )
+ throw KafkaApis.shouldNeverReceive(request)
Review Comment:
I think we shouldn't handle it like this - this is one of the request types
that is only handled by the controller listener (now that zk is gone):
> "listeners": ["zkBroker", "controller"]
So, we should have generic logic that handles that automatically before it
gets here. We can probably just delete this whole method.
--
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]