kafka icon indicating copy to clipboard operation
kafka copied to clipboard

MINOR: Remove unused controlPlaneRequestProcessor in BrokerServer.

Open appchemist opened this issue 1 year ago • 3 comments

In BrokerServer, controlPlaneRequestProcessor is always null and is not used. In addition, validateControlPlaneListenerEmptyForKRaft in KafkaConfig checks that controlPlaneListenerName is empty in KRaft mode.

So, controlPlaneRequestProcessor is not needed in BrokerServer

Committer Checklist (excluded from commit message)

  • [ ] Verify design and implementation
  • [ ] Verify test coverage and CI build status
  • [ ] Verify documentation (including upgrade notes)

appchemist avatar Jan 23 '24 11:01 appchemist

~~Git fetch failed in CI due to the error "couldn't find remote ref refs/pull/15245/head". In my machine, Build is success. Some tests failed, but the retry succeeded or is a SocketServerTest.~~

I ran the CI again

appchemist avatar Jan 23 '24 12:01 appchemist

@rondagostino Please if you can review and provide the feedback.

appchemist avatar Jan 26 '24 07:01 appchemist

@divijvaidya Would you mind reviewing this? Alternatively, who would be the best person to review this issue?

appchemist avatar Feb 14 '24 01:02 appchemist

@appchemist nice catch. could you share the context of why it gets unused ?

chia7712 avatar Mar 04 '24 12:03 chia7712

@chia7712 Thanks for review!

controlPlaneRequestProcessor in BrokerServer isn't initialized. The controlPlaneRequestProcessor is only referenced within the shutdown method.

if (controlPlaneRequestProcessor != null)
  // but below line is never called, because controlPlaneRequestProcessor is always null
  CoreUtils.swallow(controlPlaneRequestProcessor.close(), this) 

It seems likely that BrokerServer was built upon the KafkaServer codebase.(https://github.com/apache/kafka/pull/10113) KafkaServer, using Zookeeper, separates controlPlane and dataPlane to implement KIP-291. In KRaft, the roles of DataPlane and ControlPlane in KafkaServer seem to be divided into BrokerServer and ControllerServer.

It appears that the initial implementation of BrokerServer initialized and used the controlPlaneRequestProcessor, but it seems to have been removed, except for the code used in the shutdown method, through subsequent modifications.(https://github.com/apache/kafka/pull/10931)

appchemist avatar Mar 04 '24 14:03 appchemist

run the failed tests on my local:

./gradlew cleanTest core:test --tests FetchRequestTestDowngrade --tests ProduceRequestTest --tests DynamicBrokerReconfigurationTest tools:test --tests MetadataQuorumCommandTest

all pass. will merge it

chia7712 avatar Mar 05 '24 21:03 chia7712

@chia7712 sorry, I checked it late.

I run the failed tests on my local too

./gradlew cleanTest connect:mirror:test --tests MirrorConnectorsIntegrationExactlyOnceTest core:test --tests PlaintextAdminIntegrationTest --tests SaslPlainPlaintextConsumerTest --tests ZkMigrationIntegrationTest --tests SaslSslConsumerTest --tests SaslPlaintextConsumerTest --tests FetchRequestTestDowngrade --tests ProduceRequestTest --tests DynamicBrokerReconfigurationTest tools:test --tests MetadataQuorumCommandTest --tests TopicCommandIntegrationTest storage:test --tests TransactionsWithTieredStoreTest server:test --tests ClientMetricsManagerTest metadata:test --tests QuorumControllerTest

Screen_Shot_2024-03-06_At_10 08 38_Am_1 All pass too. Thank you!

appchemist avatar Mar 05 '24 22:03 appchemist