This is an automated email from the ASF dual-hosted git repository.

junrao pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new b752097  MINOR: Check for active controller in UpdateFeatures request 
processing logic (#9436)
b752097 is described below

commit b752097f849cef17d5ffcbaec1d56f32825167da
Author: Kowshik Prakasam <kpraka...@confluent.io>
AuthorDate: Thu Oct 15 10:23:05 2020 -0700

    MINOR: Check for active controller in UpdateFeatures request processing 
logic (#9436)
    
    Reviewers: Jun Rao <jun...@gmail.com>
---
 core/src/main/scala/kafka/server/KafkaApis.scala | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/core/src/main/scala/kafka/server/KafkaApis.scala 
b/core/src/main/scala/kafka/server/KafkaApis.scala
index ba8cd08..5b5c9c6 100644
--- a/core/src/main/scala/kafka/server/KafkaApis.scala
+++ b/core/src/main/scala/kafka/server/KafkaApis.scala
@@ -3133,6 +3133,8 @@ class KafkaApis(val requestChannel: RequestChannel,
 
     if (!authorize(request.context, ALTER, CLUSTER, CLUSTER_NAME)) {
       sendResponseCallback(Left(new 
ApiError(Errors.CLUSTER_AUTHORIZATION_FAILED)))
+    } else if (!controller.isActive) {
+      sendResponseCallback(Left(new ApiError(Errors.NOT_CONTROLLER)))
     } else if (!config.isFeatureVersioningSupported) {
       sendResponseCallback(Left(new ApiError(Errors.INVALID_REQUEST, "Feature 
versioning system is disabled.")))
     } else {

Reply via email to