rondagostino commented on a change in pull request #10045:
URL: https://github.com/apache/kafka/pull/10045#discussion_r569938271



##########
File path: core/src/main/scala/kafka/server/KafkaApis.scala
##########
@@ -149,12 +153,23 @@ class KafkaApis(val requestChannel: RequestChannel,
       }
     }
 
-    forwardingManager match {
-      case Some(mgr) if !request.isForwarded && !controller.isActive =>
-        mgr.forwardRequest(request, responseCallback)
+    metadataSupport match {
+      // ZooKeeper
+      case zkSupport@ZkSupport(_, _, _, forwardingManager) =>
+        forwardingManager match {
+          case Some(mgr) if !request.isForwarded && 
!zkSupport.controller.isActive =>
+            mgr.forwardRequest(request, responseCallback)
 
-      case _ =>
-        handler(request)
+          case _ =>
+            handler(request)
+        }
+      // Raft
+      case RaftSupport(fwdMgr) =>
+        if (!request.isForwarded) {
+          fwdMgr.forwardRequest(request, responseCallback)
+        } else {
+          handler(request) // will reject
+        }

Review comment:
       I added a maybeForward() method to the trait




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to