ijuma commented on code in PR #18465:
URL: https://github.com/apache/kafka/pull/18465#discussion_r1910522896
##########
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:
Yes, exactly. We can also remove the zk listener from the json files and the
socket server will automatically do the right thing, I believe (i.e. it already
has logic for that).
--
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]