Skip to content

Conversation

@jeqo
Copy link
Contributor

@jeqo jeqo commented Jan 20, 2026

Currently, diskless topic creation with replica assignment ignores the assignments and creates topic anyway with default partitions and replication factor. This can lead to unexpected/undesired states.
Instead fail and provide error message for users to fix this.

Alongside, a couple of (minor) commits are included in this PR:

  • Improve make fmt target
  • Refactor Diskless-related tests on ReplicationControlManagerTest

Note that tests have not only being moved, but they have been cleaned up and additional cases added to ensure the current behaviors are document by tests.

@jeqo jeqo requested a review from Copilot January 20, 2026 10:45
@jeqo jeqo changed the title refactor(metadata:diskless): fail on replica assignment refactor(metadata:diskless): fail on topic creation with replica assignment Jan 20, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request refactors diskless topic creation to properly reject manual replica assignments, preventing unexpected behavior where assignments were previously ignored. The PR also includes test refactoring and Makefile improvements.

Changes:

  • Added validation to reject diskless topic creation requests that include manual replica assignments
  • Refactored diskless-related tests into a nested class for better organization
  • Enhanced the make fmt target to include checkstyle tasks

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
metadata/src/main/java/org/apache/kafka/controller/ReplicationControlManager.java Added validation logic to reject manual partition assignments for diskless topics and removed the line that was silently clearing assignments
metadata/src/test/java/org/apache/kafka/controller/ReplicationControlManagerTest.java Reorganized diskless tests into a nested class, added helper method for rack-aware broker registration, and added test coverage for the new validation
Makefile Enhanced fmt target to run checkstyle tasks alongside spotless formatting

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jeqo jeqo force-pushed the jeqo/pod-2001-fail-replica-assignment branch 5 times, most recently from eae67b5 to 9448d39 Compare January 20, 2026 13:58
jeqo added 2 commits January 20, 2026 16:00
…y class

For easier testing, moving existing tests to a nested class
acknowledging the current approach as legacy.
This will allow testing existing and new approach correctly.
…assignment

Currently, diskless topic creation with replica assignment ignores the
assignments and creates topic anyway with default partitions and
replication factor. This can lead to unexpected/undesired states.
Instead fail and provide error message for users to fix this.

Existing tests changed is to align the new behavior.
@jeqo jeqo force-pushed the jeqo/pod-2001-fail-replica-assignment branch from 9448d39 to 473bb96 Compare January 20, 2026 14:01
@jeqo jeqo marked this pull request as ready for review January 20, 2026 14:56
@jeqo jeqo requested a review from giuseppelillo January 20, 2026 14:56
@giuseppelillo giuseppelillo merged commit 8c6fe5e into main Jan 20, 2026
7 checks passed
@giuseppelillo giuseppelillo deleted the jeqo/pod-2001-fail-replica-assignment branch January 20, 2026 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants