Skip to content

KAFKA-18431: Remove KafkaController#18573

Merged
ijuma merged 2 commits intoapache:trunkfrom
FrankYang0529:KAFKA-18431
Jan 17, 2025
Merged

KAFKA-18431: Remove KafkaController#18573
ijuma merged 2 commits intoapache:trunkfrom
FrankYang0529:KAFKA-18431

Conversation

@FrankYang0529
Copy link
Copy Markdown
Member

Remove KafkaController and related unused references:

  • ControllerChannelContext
  • ControllerChannelManager
  • ControllerEventManager
  • ControllerState
  • PartitionStateMachine
  • ReplicaStateMachine
  • TopicDeletionManager
  • ZkBrokerEpochManager

Committer Checklist (excluded from commit message)

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

@github-actions github-actions Bot added the core Kafka Broker label Jan 16, 2025
assertNotEquals(broker1.hashCode, broker3.hashCode)
assertNotEquals(broker1.hashCode, broker4.hashCode)

assertEquals(Some(1), Map(broker1 -> 1).get(broker1))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this test is unrelated to the zk stuff, but not too useful if we convert BrookerEndPoint to a record. I submitted #18577 for the latter.

Copy link
Copy Markdown
Member

@ijuma ijuma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice clean-up! LGTM.

@ijuma
Copy link
Copy Markdown
Member

ijuma commented Jan 16, 2025

There were a few test failures, re-running the tests to see if these are flakes. If you get a chance, try to run the failures locally to see if they are related.

@FrankYang0529
Copy link
Copy Markdown
Member Author

FrankYang0529 commented Jan 16, 2025

If you get a chance, try to run the failures locally to see if they are related.

Yes, they're related, I get error with following cases:

  • DeleteSegmentsByRetentionSizeTest#executeTieredStorageTest
  • DeleteSegmentsByRetentionTimeTest#executeTieredStorageTest
  • RollAndOffloadActiveSegmentTest#executeTieredStorageTest
  • DisableRemoteLogOnTopicTest#executeTieredStorageTest
  • EnableRemoteLogOnTopicTest#executeTieredStorageTest
  • RemoteTopicCrudTest#testClusterWideDisablementOfTieredStorageWithEnabledTieredTopic
  • DynamicConfigChangeTest#testConfigChange
  • DynamicConfigChangeTest#testDynamicTopicConfigChange

@FrankYang0529
Copy link
Copy Markdown
Member Author

I will do some debug. Thanks for the review.

Copy link
Copy Markdown
Member

@ijuma ijuma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updating review to indicate we need to fix the test failures.

@FrankYang0529
Copy link
Copy Markdown
Member Author

I found root cause. I will push the comment again. Do we want to keep BrokerEndpointTest? If yes, I will remove zk related cases only.

Signed-off-by: PoAn Yang <payang@apache.org>
@ijuma
Copy link
Copy Markdown
Member

ijuma commented Jan 16, 2025

Do we want to keep BrokerEndpointTest?

You can remove it. With the conversion to record via the other PR, the remaining test doesn't add value.

@ijuma
Copy link
Copy Markdown
Member

ijuma commented Jan 16, 2025

Btw, when you fix a PR, it's much easier for the reviewer, if you add additional commits versus rewriting the original commit (which has 7k lines of changes and some small new change somewhere in this case). In any case, can you describe what the fix was in this case?

@FrankYang0529
Copy link
Copy Markdown
Member Author

FrankYang0529 commented Jan 16, 2025

can you describe what the fix was in this case?

Sorry for that. I deleted code in TopicConfigHandler#updateLogConfig. We should not remove this. We can just fix it by removing last argument in LogManager#updateTopicConfig.

Before (remove all following code):

    // kafkaController is only defined in Zookeeper's mode
    logManager.updateTopicConfig(topic, topicConfig, kafkaConfig.remoteLogManagerConfig.isRemoteStorageSystemEnabled(),
      wasRemoteLogEnabled, kafkaController.isDefined)

After (only remove last argument):

    logManager.updateTopicConfig(topic, topicConfig, kafkaConfig.remoteLogManagerConfig.isRemoteStorageSystemEnabled(),
      wasRemoteLogEnabled)

@ijuma
Copy link
Copy Markdown
Member

ijuma commented Jan 16, 2025

Found 5 test failures:
FAILED ❌ SaslPlainPlaintextConsumerTest > testCoordinatorFailover(String, String).quorum=kraft.groupProtocol=consumer
FAILED ❌ TransactionsBounceTest > testWithGroupMetadata(String, String).quorum=kraft.groupProtocol=classic
FAILED ❌ ClientIdQuotaTest > testThrottledProducerConsumer(String, String).quorum=kraft.groupProtocol=classic
FAILED ❌ ClientIdQuotaTest > testThrottledProducerConsumer(String, String).quorum=kraft.groupProtocol=consumer
FAILED ❌ ClientIdQuotaTest > testQuotaOverrideDelete(String, String).quorum=kraft.groupProtocol=consumer
Found 4 flaky test failures:
FLAKY ⚠️ EosIntegrationTest > shouldCheckpointRestoredOffsetsWhenClosingCleanDuringRestoringStateUpdaterDisabled()
FLAKY ⚠️ AbstractCoordinatorTest > testWakeupAfterSyncGroupReceivedExternalCompletion()
FLAKY ⚠️ AbstractCoordinatorTest > testWakeupAfterSyncGroupSentExternalCompletion()
FLAKY ⚠️ KafkaAdminClientTest > testAdminClientApisAuthenticationFailure()

@FrankYang0529
Copy link
Copy Markdown
Member Author

@ijuma, Those cases can't be reproduced on my laptop. I merge trunk to trigger CI again. Thanks.

@ijuma
Copy link
Copy Markdown
Member

ijuma commented Jan 17, 2025

Looks like the tests passed.

@ijuma ijuma merged commit 0e502e0 into apache:trunk Jan 17, 2025
@FrankYang0529 FrankYang0529 deleted the KAFKA-18431 branch January 17, 2025 02:56
@FrankYang0529
Copy link
Copy Markdown
Member Author

Hi @ijuma, thanks for the review. Will you backport this to 4.0? I try to cherry-pick locally and there is no conflict. Thanks.

@ijuma
Copy link
Copy Markdown
Member

ijuma commented Jan 17, 2025

Yes, I will. I do the backports in batches and update the JIRA once they're done.

TaiJuWu pushed a commit to TaiJuWu/kafka that referenced this pull request Jan 17, 2025
Remove KafkaController and related unused references:

* ControllerChannelContext
* ControllerChannelManager
* ControllerEventManager
* ControllerState
* PartitionStateMachine
* ReplicaStateMachine
* TopicDeletionManager
* ZkBrokerEpochManager

Reviewers: Ismael Juma <ismael@juma.me.uk>
ijuma pushed a commit that referenced this pull request Jan 17, 2025
Remove KafkaController and related unused references:

* ControllerChannelContext
* ControllerChannelManager
* ControllerEventManager
* ControllerState
* PartitionStateMachine
* ReplicaStateMachine
* TopicDeletionManager
* ZkBrokerEpochManager

Reviewers: Ismael Juma <ismael@juma.me.uk>
ijuma added a commit that referenced this pull request Jan 17, 2025
Tests for this class is being removed via #18573 - making it
a record avoids the need for the tests being removed.

Reviewers: Andrew Schofield <aschofield@confluent.io>
Copy link
Copy Markdown
Member

@chia7712 chia7712 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@FrankYang0529 I apologize for the delayed response. Could you please assist me in enhancing the content of zk2kraft.html?

import scala.jdk.CollectionConverters._

object ControllerChannelManager {
private val QueueSizeMetricName = "QueueSize"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you update zk2kraft.html to say all metrics under kafka.controller:type=ControllerChannelManager are removed?

eventQueueTimeTimeoutMs: Long = 300000) {
import ControllerEventManager._

private val metricsGroup = new KafkaMetricsGroup(this.getClass)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto. all metrics under kafka.controller:type=ControllerEventManager are removed

threadNamePrefix: Option[String] = None)
extends ControllerEventProcessor with Logging {

private val metricsGroup = new KafkaMetricsGroup(this.getClass)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto. all metrics under kafka.controller:type=KafkaController are removed

}

private[controller] class ControllerStats {
private val metricsGroup = new KafkaMetricsGroup(this.getClass)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto. kafka.controller:type=ControllerStats

@FrankYang0529
Copy link
Copy Markdown
Member Author

@chia7712 Thanks for the reminder. Create a PR for it.

#18654

pranavt84 pushed a commit to pranavt84/kafka that referenced this pull request Jan 27, 2025
Remove KafkaController and related unused references:

* ControllerChannelContext
* ControllerChannelManager
* ControllerEventManager
* ControllerState
* PartitionStateMachine
* ReplicaStateMachine
* TopicDeletionManager
* ZkBrokerEpochManager

Reviewers: Ismael Juma <ismael@juma.me.uk>
pranavt84 pushed a commit to pranavt84/kafka that referenced this pull request Jan 27, 2025
Tests for this class is being removed via apache#18573 - making it
a record avoids the need for the tests being removed.

Reviewers: Andrew Schofield <aschofield@confluent.io>
airlock-confluentinc Bot pushed a commit to confluentinc/kafka that referenced this pull request Jan 27, 2025
Remove KafkaController and related unused references:

* ControllerChannelContext
* ControllerChannelManager
* ControllerEventManager
* ControllerState
* PartitionStateMachine
* ReplicaStateMachine
* TopicDeletionManager
* ZkBrokerEpochManager

Reviewers: Ismael Juma <ismael@juma.me.uk>
airlock-confluentinc Bot pushed a commit to confluentinc/kafka that referenced this pull request Jan 27, 2025
Tests for this class is being removed via apache#18573 - making it
a record avoids the need for the tests being removed.

Reviewers: Andrew Schofield <aschofield@confluent.io>
manoj-mathivanan pushed a commit to manoj-mathivanan/kafka that referenced this pull request Feb 19, 2025
Remove KafkaController and related unused references:

* ControllerChannelContext
* ControllerChannelManager
* ControllerEventManager
* ControllerState
* PartitionStateMachine
* ReplicaStateMachine
* TopicDeletionManager
* ZkBrokerEpochManager

Reviewers: Ismael Juma <ismael@juma.me.uk>
manoj-mathivanan pushed a commit to manoj-mathivanan/kafka that referenced this pull request Feb 19, 2025
Tests for this class is being removed via apache#18573 - making it
a record avoids the need for the tests being removed.

Reviewers: Andrew Schofield <aschofield@confluent.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Kafka Broker

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants