kafka
kafka copied to clipboard
MINOR: Remove unused controlPlaneRequestProcessor in BrokerServer.
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)
~~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
@rondagostino Please if you can review and provide the feedback.
@divijvaidya Would you mind reviewing this? Alternatively, who would be the best person to review this issue?
@appchemist nice catch. could you share the context of why it gets unused ?
@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)
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 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
All pass too.
Thank you!