-
Notifications
You must be signed in to change notification settings - Fork 10
fix(inkless:migration): fix classic-to-diskless migration validation #558
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -522,13 +522,19 @@ private static void validateDiskless(Map<String, String> existingConfigs, | |
| validateDisklessTransition(isCreation, isDisklessExplicitlySet, isDisklessEnabled, wasDisklessEnabled, isDisklessAllowFromClassicEnabled); | ||
|
|
||
| // Only one between diskless.enable and remote.storage.enable can be set, no matter the value. | ||
| // Exception: when classic-to-diskless migration is allowed, we permit setting diskless.enable | ||
| // on a topic that already has remote.storage.enable (the migration flow handles this). | ||
| // Exception: when classic-to-diskless migration is allowed, we permit diskless.enable=true | ||
| // on a topic that already had remote.storage.enable=true — both during the migration itself | ||
| // and in steady state afterward (migrated topics retain both configs). | ||
| // Note: in the controller path, requestedConfigs is the merged state (existing + changes), | ||
| // so we cannot distinguish "client set this" from "already existed". We detect the exception | ||
| // by checking that diskless is (or will be) enabled and remote storage was and remains enabled. | ||
| final boolean wasRemoteStorageEnabled = Boolean.parseBoolean(existingConfigs.getOrDefault(TopicConfig.REMOTE_LOG_STORAGE_ENABLE_CONFIG, "false")); | ||
| final boolean isClassicToDisklessMigration = isDisklessAllowFromClassicEnabled | ||
| && isDisklessExplicitlySet && isDisklessEnabled && !isRemoteStorageExplicitlySet | ||
| && wasRemoteStorageExplicitlySet && wasRemoteStorageEnabled; | ||
| if (!isClassicToDisklessMigration) { | ||
| final boolean requestedRemoteStorageEnabled = (Boolean) newConfigs.get(TopicConfig.REMOTE_LOG_STORAGE_ENABLE_CONFIG); | ||
| final boolean isDisklessWithRemoteStorageLegacy = isDisklessAllowFromClassicEnabled | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not getting why this is called Legacy
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agree. Maybe |
||
| && isDisklessEnabled | ||
| && wasRemoteStorageExplicitlySet && wasRemoteStorageEnabled | ||
| && requestedRemoteStorageEnabled; | ||
|
jeqo marked this conversation as resolved.
|
||
| if (!isDisklessWithRemoteStorageLegacy) { | ||
| final boolean hasExplicitDiskless = isDisklessExplicitlySet || wasDisklessExplicitlySet; | ||
| final boolean hasExplicitRemoteStorage = isRemoteStorageExplicitlySet || wasRemoteStorageExplicitlySet; | ||
| validateDisklessAndRemoteStorageMutualExclusion(isDisklessExplicitlySet, isRemoteStorageExplicitlySet, hasExplicitDiskless, hasExplicitRemoteStorage); | ||
|
jeqo marked this conversation as resolved.
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.