HDDS-4375. OM changes the block length when receives truncate request#1517
HDDS-4375. OM changes the block length when receives truncate request#1517runzhiwang wants to merge 1 commit intoapache:masterfrom
Conversation
| * Truncates an existing key. | ||
| * | ||
| * @param args the args of the key. | ||
| * @throws IOException |
There was a problem hiding this comment.
Would you please finish this java doc, there are many same issue in this PR.
For example if there is an I/O error while performing the call
|
@runzhiwang Thank you for your contribution, It's looks good overall, left a minor comments. |
captainzmc
left a comment
There was a problem hiding this comment.
LGTM overall. Just few minor comments inline.
| } | ||
|
|
||
| @Override | ||
| @SuppressWarnings("methodlength") |
There was a problem hiding this comment.
| @SuppressWarnings("methodlength") |
|
|
||
| // update usedBytes atomically. | ||
| omVolumeArgs.getUsedBytes().add(-quotaReleased); | ||
| omBucketInfo.getUsedBytes().add(-quotaReleased); |
There was a problem hiding this comment.
Here the logic to update quota can be removed and added with a TODO. Since the way to update quota will be changed in #1489, we will no longer rely on volume usedBytes and will no longer use LongAdder. Calculate quotaReleased logic can be retained.
|
|
||
| private TestOMRequestUtils() { | ||
| //Do nothing | ||
| } |
There was a problem hiding this comment.
Useless methods can be deleted
|
/pending |
|
Thank you very much for the patch. I am closing this PR temporarily as there was no activity recently and it is waiting for response from its author. It doesn't mean that this PR is not important or ignored: feel free to reopen the PR at any time. It only means that attention of committers is not required. We prefer to keep the review queue clean. This ensures PRs in need of review are more visible, which results in faster feedback for all PRs. If you need ANY help to finish this PR, please contact the community on the mailing list or the slack channel." |
What changes were proposed in this pull request?
When OM receives truncate(key, newLength),in the keyTable, OM deletes the blocks which are fully truncated, and updates the block length which is partially truncated, then return success to client.
Ozone client read key according to the block length got from OM, which has already been implemented.
So, with this PR, Ozone client can read the truncated key with newLength, when the truncate operation returns success.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-4375
How was this patch tested?
new UT and IT