-
Notifications
You must be signed in to change notification settings - Fork 614
HDDS-7526. Avoid overwriting replication config on existing bucket when quota is set #4013
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
Merged
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
f1bada1
HDDS-7526: Avoid overwriting replication config on existing bucket wh…
651ca6c
Merge branch 'apache:master' into HDDS-7526
SaketaChalamchala 0cbf5ad
HDDS-7526. Avoid overwriting replication config on existing bucket wh…
91d8fde
HDDS-7526. Avoid overwriting replication config on existing bucket wh…
1495d3e
HDDS-7526. Updated else if in OMBucketSetPropertyRequest.java
4193b4b
HDDS-7526. Removed unnecessary changes in OmBucketArgs.java
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we actually need this method in this case? In #3975 the problem was a little different. The values there were longs, which in Java cannot be null and default to zero. Therefore it was impossible to tell if zero was passed or it was just the default value. The value here is an object and can be null, so maybe its enought to check it for non null?
In OMBucketSetProperty, we have:
So we don't use this method there.
One thing that comes to mind - is it possible to remove a default rep config from a bucket, so it would then use the server default? Would we be able to? Is it a valid thing to be able to do?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review @sodonnel. You're right,
hasDefaultReplicationConfig()is not needed inOmBucketArgs.BucketArgsobject already has ahasDefaultReplicationConfig()that we can use to indicate if the replication config is set.If the replication config needs to be "reset" i.e., removed from bucket args, would it make sense to reuse null default replication config to indicate both "to retain existing replication config" and "to reset to server default"? Would another non null indicator be useful make the distinction?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we use null for "don't overwrite" and also "clear" I am not sure how we can make the distinction.
To clear the replicationConfig, I think you will need:
bucket.setReplicationConfig(...)We can be fairly sure someone will come asking to clear the replicationConfig on a bucket some day, so it would be good to fix this. However I would do it in another Jira than this one, as I think this one is good now.