-
Notifications
You must be signed in to change notification settings - Fork 588
HDDS-4308. Fix issue with quota update #1489
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
75a47a6 to
e6a0ecd
Compare
e6a0ecd to
f3744e7
Compare
|
Hi @bharatviswa504, Can you help to review this PR. |
|
Hi @linyiqun,I modified the implementation based on the latest comments. Can you help to review this PR. |
...p-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyRequest.java
Outdated
Show resolved
Hide resolved
dcfdb76 to
dfc8e50
Compare
|
Hi @bharatviswa504 @linyiqun, This PR has been modified. Can you help to review this PR. |
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.
Hi @captainzmc , please have a look for the latest 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.
Method name setUsedBytes seems confused, can we rename to incrUsedBytes(long bytes)
...ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/file/OMFileCreateRequest.java
Outdated
Show resolved
Hide resolved
...ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/file/OMFileCreateRequest.java
Outdated
Show resolved
Hide resolved
...java/org/apache/hadoop/ozone/om/request/s3/multipart/S3MultipartUploadCommitPartRequest.java
Outdated
Show resolved
Hide resolved
b5a50df to
a3c5ba2
Compare
...ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/file/OMFileCreateRequest.java
Show resolved
Hide resolved
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.
Thanks for addressing the comments, @captainzmc ! Leave one minor comment.
@bharatviswa504 , does current fix way make sense to you?
...ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/file/OMFileCreateRequest.java
Show resolved
Hide resolved
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.
LGTM +1.
Let's wait for others to have a look for latest change as well, : ).
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 volume lock for key operations we serialize all bucket ops across volume which have major perf impact. (I understand why we need it, I am just thinking if there are some ways we can avoid it)
So some general questions on Quota:
- Can we skip updating volume bytes used during key operations, when it is required just calculated bytes used from all bucket info. As with volume lock, it affects key operations.
- During bucket creation why can't we make check if buckets created exceed volume quota set if so, fail bucket creation. In this way, during key operations we don't need to check volume bytesUsed, just bucket bytesUsed will be enough.
Example:
volume quota 100 MB
Bucket1 90MB success
Bucket2 20MB fail(As total volume quota is 100MB)
With this approach, we don't need to check volume quota during key ops. (It has impact ony during quota set operation which is not a frequent operation on the cluster)
- Is there a way to disable quota feature? My question is so when upgraded during key creation we by default bytesUsed. And when not required, we don't need to update bytesUsed. (I see that we have check during checkQuota, but not during update bytesUsed)
|
Thanks for @bharatviswa504's optimization Suggestions.
This bytesUsed should be updated all the time. If quota is not enabled when a bucket is created, then quota is enabled after a certain amount of data is written. At this point we need to know how much bytesUsed was before quota was enabled so that we can correctly update it.
Agree, I think this is a better way to avoid the current use of Volume lock. I will modify this PR in this way as soon as possible. cc @linyiqun |
|
Also +1 with no volume lock approach and aggregate the bucket bytes used instead.
Agreed, bytes used still needed but don't need to do any quota check if we have a way to disable quota. |
29c4852 to
d9d17aa
Compare
|
Hi @bharatviswa504 @linyiqun. Based on what we discussed yesterday, I revised the PR. Can you take another look?
|
|
We no longer need to update volume usedBytes in Response. You can also delete the logic for updating volume usedBytes in Response. |
|
Now that we no longer need the usebyte of the volume; You need to synchronize the contents of quote.md. |
|
Overall LGTM. Just a couple of minor suggestions. |
|
The issues has been fixed. Can you take another look? @runzhiwang |
.../ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeysDeleteRequest.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmBucketInfo.java
Outdated
Show resolved
Hide resolved
...e/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyCommitRequest.java
Show resolved
Hide resolved
...e/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyDeleteRequest.java
Outdated
Show resolved
Hide resolved
|
Thanks for @runzhiwang‘s review. The issues has been fixed. |
runzhiwang
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.
|
@captainzmc Thanks the patch. @bharatviswa504 @linyiqun Thanks for review. I have merged the patch. |
|
@captainzmc and @runzhiwang , I noticed that we also removed below function: protected void checkVolumeQuotaInBytes(OmVolumeArgs omVolumeArgs,
long allocateSize) throws IOException {
...
}So now where we will check the quota usage of the volume? There should be one place to do the sum of volume buckets usage and then do the quota check. |
|
Thanks for @linyiqun's attention. For now we no longer need to check the Quota of Volume. Because we have ensured that all bucket quota and do not exceed volume quota when we set bucket and volume quota. Therefore, to write a key under a bucket, we simply check bucket quota. Volume's quota will naturally not exceed as long as the bucket's quota checks pass. |
|
Sounds good, thanks @captainzmc for the explanation. |
* HDDS-3698-upgrade: HDDS-4429. Create unit test for SimpleContainerDownloader. (apache#1551) HDDS-4461. Reuse compiled binaries in acceptance test (apache#1588) HDDS-4511: Avoiding StaleNodeHandler to take effect in TestDeleteWithSlowFollower. (apache#1625) HDDS-4510. SCM can avoid creating RetriableDatanodeEventWatcher for deletion command ACK (apache#1626) HDDS-3363. Intermittent failure in testContainerImportExport (apache#1618) HDDS-4370. Datanode deletion service can avoid storing deleted blocks. (apache#1620) HDDS-4512. Remove unused netty3 transitive dependency (apache#1627) HDDS-4481. With HA OM can send deletion blocks to SCM multiple times. (apache#1608) HDDS-4487. SCM can avoid using RETRIABLE_DATANODE_COMMAND for datanode deletion commands. (apache#1621) HDDS-4471. GrpcOutputStream length can overflow (apache#1617) HDDS-4308. Fix issue with quota update (apache#1489) HDDS-4392. [DOC] Add Recon architecture to docs (apache#1602) HDDS-4501. Reload OM State fail should terminate OM for any exceptions. (apache#1622) HDDS-4492. CLI flag --quota should default to 'spaceQuota' to preserve backward compatibility. (apache#1609) HDDS-3689. Add various profiles to MiniOzoneChaosCluster to run different modes. (apache#1420) HDDS-4497. Recon File Size Count task throws SQL Exception. (apache#1612)
* HDDS-3698-upgrade: HDDS-4429. Create unit test for SimpleContainerDownloader. (apache#1551) HDDS-4461. Reuse compiled binaries in acceptance test (apache#1588) HDDS-4511: Avoiding StaleNodeHandler to take effect in TestDeleteWithSlowFollower. (apache#1625) HDDS-4510. SCM can avoid creating RetriableDatanodeEventWatcher for deletion command ACK (apache#1626) HDDS-3363. Intermittent failure in testContainerImportExport (apache#1618) HDDS-4370. Datanode deletion service can avoid storing deleted blocks. (apache#1620) HDDS-4512. Remove unused netty3 transitive dependency (apache#1627) HDDS-4481. With HA OM can send deletion blocks to SCM multiple times. (apache#1608) HDDS-4487. SCM can avoid using RETRIABLE_DATANODE_COMMAND for datanode deletion commands. (apache#1621) HDDS-4471. GrpcOutputStream length can overflow (apache#1617) HDDS-4308. Fix issue with quota update (apache#1489) HDDS-4392. [DOC] Add Recon architecture to docs (apache#1602) HDDS-4501. Reload OM State fail should terminate OM for any exceptions. (apache#1622) HDDS-4492. CLI flag --quota should default to 'spaceQuota' to preserve backward compatibility. (apache#1609) HDDS-3689. Add various profiles to MiniOzoneChaosCluster to run different modes. (apache#1420) HDDS-4497. Recon File Size Count task throws SQL Exception. (apache#1612)
* master: (40 commits) HDDS-4473. Reduce number of sortDatanodes RPC calls (apache#1610) HDDS-4485. [DOC] add the authentication rules of the Ozone Ranger. (apache#1603) HDDS-4528. Upgrade slf4j to 1.7.30 (apache#1639) HDDS-4424. Update README with information how to report security issues (apache#1548) HDDS-4484. Use RaftServerImpl isLeader instead of periodic leader update logic in OM and isLeaderReady for read/write requests (apache#1638) HDDS-4429. Create unit test for SimpleContainerDownloader. (apache#1551) HDDS-4461. Reuse compiled binaries in acceptance test (apache#1588) HDDS-4511: Avoiding StaleNodeHandler to take effect in TestDeleteWithSlowFollower. (apache#1625) HDDS-4510. SCM can avoid creating RetriableDatanodeEventWatcher for deletion command ACK (apache#1626) HDDS-3363. Intermittent failure in testContainerImportExport (apache#1618) HDDS-4370. Datanode deletion service can avoid storing deleted blocks. (apache#1620) HDDS-4512. Remove unused netty3 transitive dependency (apache#1627) HDDS-4481. With HA OM can send deletion blocks to SCM multiple times. (apache#1608) HDDS-4487. SCM can avoid using RETRIABLE_DATANODE_COMMAND for datanode deletion commands. (apache#1621) HDDS-4471. GrpcOutputStream length can overflow (apache#1617) HDDS-4308. Fix issue with quota update (apache#1489) HDDS-4392. [DOC] Add Recon architecture to docs (apache#1602) HDDS-4501. Reload OM State fail should terminate OM for any exceptions. (apache#1622) HDDS-4492. CLI flag --quota should default to 'spaceQuota' to preserve backward compatibility. (apache#1609) HDDS-3689. Add various profiles to MiniOzoneChaosCluster to run different modes. (apache#1420) ...
…ge request !66) Squash merge branch '2020-11-30' into 'tencent-master' * HDDS-4308. Fix issue with quota update (apache#1489)
… (merge request !66) This reverts commit dfcd441
Revert cherry-pick HDDS-4308. Fix issue with quota update (apache#1489) (merge request !66) This reverts commit dfcd441
What changes were proposed in this pull request?
Currently volumeArgs using getCacheValue and put the same object in doubleBuffer, this might cause issue.
Let's take the below scenario:
InitialVolumeArgs quotaBytes -> 10000
Now at the end of flushing these transactions, our DB should have 7000 as bytes used.
Now T1 is picked by double Buffer and when it commits, and as it uses cached Object put into doubleBuffer, it flushes to DB with the updated value from T2(As it is a cache object) and update DB with bytesUsed as 7000.
And now OM has restarted, and only DB has transactions till T1. (We get this info from TransactionInfo Table(https://issues.apache.org/jira/browse/HDDS-3685)
Now T2 is again replayed, as it is not committed to DB, now DB will be again subtracted with 2000, and now DB will have 5000.
But after T2, the value should be 7000, so we have DB in an incorrect state.
Issue here:
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-4308
How was this patch tested?
Use the existing UT