Adds expected file to import config command#6342
Open
keith-turner wants to merge 4 commits intoapache:mainfrom
Open
Adds expected file to import config command#6342keith-turner wants to merge 4 commits intoapache:mainfrom
keith-turner wants to merge 4 commits intoapache:mainfrom
Conversation
Adds a new option to the import config command to provide an optional expected file. If the expected file is provided, then updates are only made if the expected file equals the current properties in zookeeper. The expected check is done atomically. ```bash accumulo conf export > export.yaml cp export.yaml copy.yaml vim copy.yaml // edit config accumulo conf import --input copy.yaml --expected export.yaml ``` The import would fail if any config changes were made after the export. Added this new option as a safer way to do what zoo-prop-editor does, plan to deprecate or remove zoo-prop-editor after this is merged. Another use case this new option supports is detecting changes between pushing updates from CM. For example if a new config update needs to applied from CM, can check if the previous update from CM is still as is. This would make the import command fail if any changes were made outside of CM. ```bash accumulo conf import --input new-from-cm.yaml --expected prev-from-cm.yaml ```
keith-turner
commented
Apr 28, 2026
| // validate all scope+name before attempting to update any scope+name | ||
| for (var scopedProps : allProps) { | ||
| var propStoreKey = getKey(scopedProps.scope(), scopedProps.name(), serverContext); | ||
| PropUtil.validateProperties(serverContext, propStoreKey, scopedProps.props()); |
Contributor
Author
There was a problem hiding this comment.
Realized the --dryrun option is not checking expected, need to add that here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a new option to the import config command to provide an optional expected file. If the expected file is provided, then updates are only made if the expected file equals the current properties in zookeeper. The expected check is done atomically.
The import would fail if any config changes were made after the export. Added this new option as a safer way to do what zoo-prop-editor does, plan to deprecate or remove zoo-prop-editor after this is merged.
Another use case this new option supports is detecting changes between pushing updates from CM. For example if a new config update needs to applied from CM, can check if the previous update from CM is still as is. This would make the import command fail if any changes were made outside of CM.