Status

Current state"Under Discussion"

Discussion thread:  https://lists.apache.org/thread.html/r0de1dfb885c3e47039f57edc4cf9e192f6b4f3e1ff947a651b1605de%40%3Cdev.kafka.apache.org%3E

JIRAKAFKA-10891

Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).


Motivation

This KIP is an extension of KIP-291.

At present,data requests and control requests use different endpoints,these endpoints are all registered to ZooKeeper.

The client can define the "bootstrap-servers" as the control plane,this causes the control plane regresses to the data plane.This would violate the design work of KIP-291.

Whether it is used unintentionally or intentionally, this is the problem faced by the current control plane.

When the user administrator wants to deny the data request access control plane completely, this cannot be done now.

So We need to provide a way for the control plane to reject data requests.

Also, when the control plane is enabled, the broker needs to communicate with the controller using the control plane to send the controlledShutdown request.


Public Interfaces

Add an optional configuration on the broker side:


Proposed Changes

Add isControlPlane to the constructor of the processor, this value is passed in when the processor associated with the data plane and the control plane is created. "control.plane.force.controller.requests.enable" is disabled by default.The default control plane does not reject data requests, which can remain compatible when the user uses the control plane for data requests.

If control.plane.force.controller.requests.enable is true, the control plane should allow only four kinds of requests:  LeaderAndIsrRequest,UpdateMetadataRequest,StopReplicaRequest,ControlledShutdownRequest.

class Processor(val id: Int,
                               time: Time,
                               maxRequestSize: Int,
                               requestChannel: RequestChannel,
                               connectionQuotas: ConnectionQuotas,
                               connectionsMaxIdleMs: Long,
                               failedAuthenticationDelayMs: Int,
                               listenerName: ListenerName,
                               securityProtocol: SecurityProtocol,
                               config: KafkaConfig,
                               metrics: Metrics,
                               credentialProvider: CredentialProvider,
                               memoryPool: MemoryPool,
                               logContext: LogContext,
                               connectionQueueSize: Int = ConnectionQueueSize,
                               isPrivilegedListener: Boolean = false,
                               allowDisabledApis: Boolean = false,
                               isControlPlane: Boolean = false)


Compatibility, Deprecation, and Migration Plan

This KIP is consistent with KIP-291.

Rejected Alternatives