[ 
https://issues.apache.org/jira/browse/HDFS-17839?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18022122#comment-18022122
 ] 

ASF GitHub Bot commented on HDFS-17839:
---------------------------------------

huangzhaobo99 commented on code in PR #7989:
URL: https://github.com/apache/hadoop/pull/7989#discussion_r2371739527


##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirRenameOp.java:
##########
@@ -72,14 +72,24 @@ static RenameResult renameToInt(
    * Verify quota for rename operation where srcInodes[srcInodes.length-1] 
moves
    * dstInodes[dstInodes.length-1]
    */
-  private static Pair<Optional<QuotaCounts>, Optional<QuotaCounts>> 
verifyQuotaForRename(
-      FSDirectory fsd, INodesInPath src, INodesInPath dst) throws 
QuotaExceededException {
+  private static Triple<Boolean, Optional<QuotaCounts>, Optional<QuotaCounts>> 
verifyQuotaForRename(
+      FSDirectory fsd, INodesInPath src, INodesInPath dst, boolean overwrite)
+      throws QuotaExceededException {

Review Comment:
   ```
     /**
      * Verify quota for rename operation where srcInodes[srcInodes.length-1] 
moves
      * dstInodes[dstInodes.length-1]
      *
      * @param fsd       FSDirectory instance
      * @param src       Source path inodes
      * @param dst       Destination path inodes
      * @param overwrite Whether destination will be overwritten
      * @return Triple containing:
      * - Boolean: true if quota was updated, false if skipped
      * - Optional<QuotaCounts>: Source path quotaCounts delta
      * - Optional<QuotaCounts>: Destination path quotaCounts delta
      * @throws QuotaExceededException if quota limit is exceeded
      */
   ```





> Rename skips path without valid 'DirectoryWithQuotaFeature' in FSDirRenameOp
> ----------------------------------------------------------------------------
>
>                 Key: HDFS-17839
>                 URL: https://issues.apache.org/jira/browse/HDFS-17839
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>            Reporter: Zhaobo Huang
>            Assignee: Zhaobo Huang
>            Priority: Major
>              Labels: pull-request-available
>
> Calculating quota usage is primarily used to update directories labeled with 
> the DirectoryWithQuotaFeature. When there is no valid 
> DirectoryWithQuotaFeature in the paths of src and dst (excluding the root 
> directory), the quota should not be calculated in rename scenarios:
> 1. rename1 does not change the quota of the root directory, so neither src 
> nor dst contains DirectoryWithQuotaFeature (excluding the root directory). 
> The operation of calculating quota should be skipped.
> 2. In the scenario of overwriting, rename2 still needs to consider 
> calculating quota, otherwise it will affect the quotaUsage value of the root 
> directory.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to