-
Notifications
You must be signed in to change notification settings - Fork 587
HDDS-4588. If volume's quota is enabled then bucket's quota cannot be cleared #1723
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
Conversation
abdbfbe to
331219c
Compare
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.
Nit: will it better to use more descriptive names than variable names. For example, replace quotaInBytes by space quota?
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.
Nit: same, maybe replace quotaInNamespace by namespace quota?
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.
Agreed with @amaliujia 's suggestion. I also prefer to do below rename changing for more readable:
quotaInNamespace -> namespaceQuota
quotaInNamespace -> spaceQuota
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.
I am thinking for this case, it's okay to just clear bucket quota no matter if the volume quota was set? Since the volume quota check will still make the sense, when we clear one bucket quota.
ayushtkn
left a comment
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.
Thanx @captainzmc for the work here.
dropped some minor comments,
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.
Can try something like this -
LambdaTestUtils.intercept(IOException.class, "Before clear bucket "
+ "quotaInBytes, volume quotaInBytes need to be clear first.",
() -> ozoneBucket.clearSpaceQuota());
Shall save lines and looks better
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.
Similarly here -
LambdaTestUtils.intercept(IOException.class, "Before clear bucket "
+ "quotaInNamespace, volume quotaInNamespace need to be clear first.",
() -> ozoneBucket.clearCountQuota());
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.
Seems some grammatical error in the message, Can you check and reframe if possible,
May be something like a warning, Can not clear bucket namespace quota because volume namespace quota is not unset. Or may be something better....
There is a very detailed discussion of this. |
|
Fixed review issues. |
@captainzmc , although we removed the volume usedBytes because of the quota update issue. Can we also try to sum the buckets used bytes when bucket is created that will be used for the volume quota check? As I see we already do the similar check for the quota valid check, OMBucketCreateRequest.java#L331 |
Thanks for @linyiqun‘ advice. |
If there is the performance consideration for this, I am okay for this. |
linyiqun
left a comment
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.
+1 for this PR change.
ayushtkn
left a comment
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.
LGTM
dcf44ff to
ec5984e
Compare
|
Removed the namespace restriction, as discussed in #1736. cc @amaliujia |
|
LGTM |
|
Merged this patch, Thanks for @linyiqun @amaliujia @ayushtkn for the review. |
What changes were proposed in this pull request?
If volume's quota is enabled then bucket's quota cannot be cleared. We need to prompt the user to clear volume quota first.
For more details.
To prevent conflicts, I have updated the usage and behavior of clear space quota in #1677.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-4588
How was this patch tested?
ut added