Skip to content

feat(inkless:switch): validate diskless requires remote storage when consolidation enabled#616

Merged
giuseppelillo merged 2 commits into
mainfrom
jeqo/kc-149-diskless-remote-storage-config
May 28, 2026
Merged

feat(inkless:switch): validate diskless requires remote storage when consolidation enabled#616
giuseppelillo merged 2 commits into
mainfrom
jeqo/kc-149-diskless-remote-storage-config

Conversation

@jeqo

@jeqo jeqo commented May 28, 2026

Copy link
Copy Markdown
Contributor

When remote storage consolidation is enabled, reject enabling diskless if remote.storage.enable is explicitly set to false. Allow omission — the controller will auto-persist remote.storage.enable=true.

Also expands isSwitchedFromClassicWithRemoteStorage() to permit CLASSIC→DISKLESS direct switch when consolidation is on and remote storage is being enabled in the same request.

@jeqo jeqo marked this pull request as ready for review May 28, 2026 08:31
@jeqo jeqo requested a review from Copilot May 28, 2026 08:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Tightens diskless/remote-storage validation when remote-storage consolidation is enabled: a new validateDisklessRequiresRemoteStorage check rejects enabling diskless together with an explicit remote.storage.enable=false, while allowing the implicit-default case (the controller auto-persists remote.storage.enable=true). Also widens isSwitchedFromClassicWithRemoteStorage() so that a CLASSIC→DISKLESS direct switch can set both flags in the same request when consolidation is on.

Changes:

  • Refactor isSwitchedFromClassicWithRemoteStorage() to additionally accept a CLASSIC→DISKLESS switch when consolidation is on and remote storage becomes newly enabled.
  • Add validateDisklessRequiresRemoteStorage() invoked from validateDiskless() whenever consolidation is enabled.
  • Update existing LogConfigTest comments to reflect the new "auto-enable" / "mutual exclusion fires first" semantics.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
storage/src/main/java/org/apache/kafka/storage/internals/log/LogConfig.java Expands classic-switch acceptance for direct CLASSIC→DISKLESS transitions and adds a consolidation-gated diskless-requires-remote-storage invariant.
core/src/test/scala/unit/kafka/log/LogConfigTest.scala Comment-only updates clarifying that diskless without explicit remote.storage.enable is now allowed, and that mutual exclusion still fires first for the explicit false case.

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

Comment thread storage/src/main/java/org/apache/kafka/storage/internals/log/LogConfig.java Outdated
@jeqo jeqo force-pushed the jeqo/kc-149-diskless-remote-storage-config branch from 126c4bd to a79635e Compare May 28, 2026 08:47
@jeqo jeqo requested a review from Copilot May 28, 2026 08:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

…consolidation enabled

When remote storage consolidation is enabled, reject enabling diskless
if remote.storage.enable is explicitly set to false. Allow omission —
the controller will auto-persist remote.storage.enable=true.

Also expands isSwitchedFromClassicWithRemoteStorage() to permit
CLASSIC→DISKLESS direct switch when consolidation is on and remote
storage is being enabled in the same request.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jeqo jeqo force-pushed the jeqo/kc-149-diskless-remote-storage-config branch from a79635e to 8d2994c Compare May 28, 2026 08:57
@jeqo jeqo requested a review from giuseppelillo May 28, 2026 08:57
// Diskless topics must have remote storage enabled.
// Only reject when remote.storage.enable is explicitly set to false.
// If remote.storage.enable was never set (implicit default), allow —
// the controller will auto-enable remote storage via config record.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

When does this happen? Could not find anything

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

it's coming as a follow-up: #619

@giuseppelillo giuseppelillo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. After this feature is code-completed we will need to test it in an integration test like kafka.server.DisklessAndRemoteStorageConfigsTest.

@giuseppelillo giuseppelillo merged commit da287c9 into main May 28, 2026
6 checks passed
@giuseppelillo giuseppelillo deleted the jeqo/kc-149-diskless-remote-storage-config branch May 28, 2026 13:20
giuseppelillo pushed a commit that referenced this pull request May 29, 2026
…consolidation enabled (#616)

* feat(inkless:switch): validate diskless requires remote storage when consolidation enabled

When remote storage consolidation is enabled, reject enabling diskless
if remote.storage.enable is explicitly set to false. Allow omission —
the controller will auto-persist remote.storage.enable=true.

Also expands isSwitchedFromClassicWithRemoteStorage() to permit
CLASSIC→DISKLESS direct switch when consolidation is on and remote
storage is being enabled in the same request.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fixup! feat(inkless:switch): validate diskless requires remote storage when consolidation enabled

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
giuseppelillo pushed a commit that referenced this pull request May 29, 2026
…consolidation enabled (#616)

* feat(inkless:switch): validate diskless requires remote storage when consolidation enabled

When remote storage consolidation is enabled, reject enabling diskless
if remote.storage.enable is explicitly set to false. Allow omission —
the controller will auto-persist remote.storage.enable=true.

Also expands isSwitchedFromClassicWithRemoteStorage() to permit
CLASSIC→DISKLESS direct switch when consolidation is on and remote
storage is being enabled in the same request.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fixup! feat(inkless:switch): validate diskless requires remote storage when consolidation enabled

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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