feat(inkless:switch): validate diskless requires remote storage when consolidation enabled#616
Conversation
There was a problem hiding this comment.
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 fromvalidateDiskless()whenever consolidation is enabled. - Update existing
LogConfigTestcomments 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.
126c4bd to
a79635e
Compare
…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>
a79635e to
8d2994c
Compare
…e when consolidation enabled
| // 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. |
There was a problem hiding this comment.
When does this happen? Could not find anything
giuseppelillo
left a comment
There was a problem hiding this comment.
LGTM. After this feature is code-completed we will need to test it in an integration test like kafka.server.DisklessAndRemoteStorageConfigsTest.
…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>
…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>
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.