Skip to content

Conversation

@captainzmc
Copy link
Member

@captainzmc captainzmc commented Dec 18, 2020

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

@captainzmc captainzmc force-pushed the fix-clear branch 2 times, most recently from abdbfbe to 331219c Compare December 18, 2020 12:53
Copy link
Contributor

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?

Copy link
Contributor

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?

Copy link
Contributor

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

Copy link
Contributor

@linyiqun linyiqun left a 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.

Copy link
Member

@ayushtkn ayushtkn left a 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,

Comment on lines 314 to 320
Copy link
Member

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

Comment on lines 322 to 329
Copy link
Member

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());

Comment on lines 274 to 275
Copy link
Member

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....

@captainzmc
Copy link
Member Author

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.

There is a very detailed discussion of this.

@captainzmc
Copy link
Member Author

Fixed review issues.

@linyiqun
Copy link
Contributor

linyiqun commented Dec 23, 2020

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.

There is a very detailed discussion of this.

@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

@captainzmc
Copy link
Member Author

captainzmc commented Dec 24, 2020

@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.
We've considered this option before, but it can cause performance problems.
Let's assume that we have 1000 buckets under volume.
First set quota, which is not a very frequent action in a cluster, and unlike the write operation, has a low latency requirement. So we calculated that all bucket quota is acceptable.
However, each write operation calculating the usedBytes of all buckets for volume quota checker may affect write performance. The more buckets there are, the more performance is affected per write. This maybe unacceptable to the users.
Also if we do this, we need to lock the volume when we count all the usedBytes of our buckets, because we don't want the usedBytes of our buckets to change back and forth when we calculate the total usedBytes, which will also affect the performance.

@linyiqun
Copy link
Contributor

linyiqun commented Dec 24, 2020

However, each write operation calculating the usedBytes of all buckets for volume quota checker may affect write performance. The more buckets there are, the more performance is affected per write. This maybe unacceptable to the users.
Also if we do this, we need to lock the volume when we count all the usedBytes of our buckets, because we don't want the usedBytes of our buckets to change back and forth when we calculate the total usedBytes, which will also affect the performance.

If there is the performance consideration for this, I am okay for this.

Copy link
Contributor

@linyiqun linyiqun left a 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.

Copy link
Member

@ayushtkn ayushtkn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@captainzmc
Copy link
Member Author

captainzmc commented Dec 28, 2020

Removed the namespace restriction, as discussed in #1736. cc @amaliujia

@amaliujia
Copy link
Contributor

LGTM

@captainzmc captainzmc merged commit 2e4caa2 into apache:master Dec 29, 2020
@captainzmc
Copy link
Member Author

Merged this patch, Thanks for @linyiqun @amaliujia @ayushtkn for the review.

@captainzmc captainzmc removed the request for review from bharatviswa504 December 29, 2020 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants