ThinkerLei commented on code in PR #6653: URL: https://github.com/apache/hadoop/pull/6653#discussion_r1538895771
########## hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirRenameOp.java: ########## @@ -681,14 +703,46 @@ private static class RenameOperation { this.srcIIP = INodesInPath.replace(srcIIP, srcIIP.length() - 1, srcChild); // get the counts before rename - oldSrcCounts.add(withCount.getReferredINode().computeQuotaUsage(bsps)); + oldSrcCountsInSnapshot.add(withCount.getReferredINode().computeQuotaUsage(bsps)); } else if (srcChildIsReference) { // srcChild is reference but srcChild is not in latest snapshot withCount = (INodeReference.WithCount) srcChild.asReference() .getReferredINode(); } else { withCount = null; } + // set quota for src and dst, ignore src is in Snapshot or is Reference + this.srcSubTreeCountOp = withCount == null ? + quotaPair.getLeft() : Optional.empty(); + this.dstSubTreeCountOp = quotaPair.getRight(); + } + + boolean isSameStoragePolicy() { Review Comment: This scenario corresponds to the case where the source INode itself has a storage policy. Under such circumstances, we consistently need to use its own storage policy to calculate the quota, rather than the storage policy of the target directory. -- 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: common-issues-unsubscr...@hadoop.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-issues-h...@hadoop.apache.org