[
https://issues.apache.org/jira/browse/HDFS-16428?focusedWorklogId=711935&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-711935
]
ASF GitHub Bot logged work on HDFS-16428:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 20/Jan/22 09:20
Start Date: 20/Jan/22 09:20
Worklog Time Spent: 10m
Work Description: wojiaodoubao commented on a change in pull request
#3898:
URL: https://github.com/apache/hadoop/pull/3898#discussion_r788553837
##########
File path:
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirRenameOp.java
##########
@@ -81,8 +81,12 @@ private static void verifyQuotaForRename(FSDirectory fsd,
INodesInPath src,
// Assume dstParent existence check done by callers.
INode dstParent = dst.getINode(-2);
// Use the destination parent's storage policy for quota delta verify.
+ final boolean isSrcSetSp = src.getLastINode().isSetStoragePolicy();
+ final byte storagePolicyID = isSrcSetSp ?
+ src.getLastINode().getLocalStoragePolicyID() :
+ dstParent.getStoragePolicyID();
final QuotaCounts delta = src.getLastINode()
Review comment:
Can we also add a test case to verify the quota check part.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 711935)
Time Spent: 1h 20m (was: 1h 10m)
> Source path setted storagePolicy will cause wrong typeConsumed in rename
> operation
> -----------------------------------------------------------------------------------
>
> Key: HDFS-16428
> URL: https://issues.apache.org/jira/browse/HDFS-16428
> Project: Hadoop HDFS
> Issue Type: Bug
> Components: hdfs, namenode
> Reporter: lei w
> Assignee: lei w
> Priority: Major
> Labels: pull-request-available
> Attachments: example.txt
>
> Time Spent: 1h 20m
> Remaining Estimate: 0h
>
> When compute quota in rename operation , we use storage policy of the target
> directory to compute src quota usage. This will cause wrong value of
> typeConsumed when source path was setted storage policy. I provided a unit
> test to present this situation.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]