Skip to content

KAFKA-18584: Fix controller restart in combined mode - #23043

Open
lh0156 wants to merge 1 commit into
apache:trunkfrom
lh0156:agent/KAFKA-18584-controller-restart-test
Open

KAFKA-18584: Fix controller restart in combined mode#23043
lh0156 wants to merge 1 commit into
apache:trunkfrom
lh0156:agent/KAFKA-18584-controller-restart-test

Conversation

@lh0156

@lh0156 lh0156 commented Aug 2, 2026

Copy link
Copy Markdown

Closes KAFKA-18584

Summary

  • Exercise testControllerRestart under both isolated and combined KRaft modes.
  • Keep the shared Raft manager alive while the broker still owns it during a combined-mode controller restart.

In combined mode, ControllerServer.shutdown() previously shut down the shared Raft manager even though the broker continued using it. Restarting the controller could then observe a null manager and fail with the NPE reported in KAFKA-18584. The lifecycle guard preserves the manager until the broker releases it.

Tests

  • ./gradlew :test-common:test-common-runtime:test --tests org.apache.kafka.common.test.junit.ClusterTestExtensionsTest --no-build-cache --console=plain
  • ./gradlew :core:spotlessCheck :test-common:test-common-runtime:spotlessCheck --no-build-cache --console=plain
  • ./gradlew :core:checkstyleMain :test-common:test-common-runtime:checkstyleTest --no-build-cache --console=plain

The targeted regression test passed three fresh reruns for both KRaft modes, and the full ClusterTestExtensionsTest passed.

Exercise the controller restart test in both isolated and combined KRaft modes. In combined mode, the broker still owns the shared Raft manager while the controller is restarted, so controller shutdown must not tear it down.

Tests: ./gradlew :test-common:test-common-runtime:test --tests org.apache.kafka.common.test.junit.ClusterTestExtensionsTest --no-build-cache --console=plain

Generated-by: OpenAI Codex (GPT-5)
Signed-off-by: 엄윤섭 <62834176+lh0156@users.noreply.github.com>
@github-actions github-actions Bot added triage PRs from the community core Kafka Broker small Small PRs labels Aug 2, 2026
@github-actions

Copy link
Copy Markdown

A label of 'needs-attention' was automatically added to this PR in order to raise the
attention of the committers. Once this issue has been triaged, the triage label
should be removed to prevent this automation from happening again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Kafka Broker needs-attention small Small PRs triage PRs from the community

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant