[
https://issues.apache.org/jira/browse/HDFS-16428?focusedWorklogId=711139&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-711139
]
ASF GitHub Bot logged work on HDFS-16428:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 19/Jan/22 07:23
Start Date: 19/Jan/22 07:23
Worklog Time Spent: 10m
Work Description: ThinkerLei commented on a change in pull request #3898:
URL: https://github.com/apache/hadoop/pull/3898#discussion_r787408830
##########
File path:
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestQuota.java
##########
@@ -958,6 +959,33 @@ public void testQuotaByStorageType() throws Exception {
6 * fileSpace);
}
+ @Test
+ public void testRenameInodeWithStorageType() throws IOException {
+ final int SIZE = 64;
+ final short REPL = 1;
+ final Path foo = new Path("/foo");
+ final Path bs1 = new Path(foo, "bs1");
+ final Path wow = new Path(bs1, "wow");
+ final Path bs2 = new Path(foo, "bs2");
+ final Path wow2 = new Path(bs2,"wow2");
+
+ dfs.mkdirs(bs1, FsPermission.getDirDefault());
+ dfs.mkdirs(bs2, FsPermission.getDirDefault());
+ dfs.setQuota(bs1,1000, 434217728);
+ dfs.setQuota(bs2,1000, 434217728);
+ dfs.setStoragePolicy(bs2, HdfsConstants.ONESSD_STORAGE_POLICY_NAME);
+
+ DFSTestUtil.createFile(dfs, wow, SIZE, REPL, 0);
+ DFSTestUtil.createFile(dfs, wow2, SIZE, REPL, 0);
+ assertTrue("without storage policy, typeConsumed should be 0.",
+ dfs.getQuotaUsage(bs1).getTypeConsumed(StorageType.SSD) == 0);
+ assertTrue("with storage policy, typeConsumed should not be 0.",
+ dfs.getQuotaUsage(bs2).getTypeConsumed(StorageType.SSD) != 0);
+ dfs.rename(bs2, bs1);
+ assertTrue("rename with storage policy, typeConsumed should not be 0.",
+ dfs.getQuotaUsage(bs1).getTypeConsumed(StorageType.SSD) != 0);
Review comment:
@ayushtkn thank you very much for your comment. Yes, directory bs1 is
hot but its subdirectory bs2 is setted one_ssd. In this situation, dir bs2 will
use itself block storage policy rather than his parent storage policy, is it?
--
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: 711139)
Time Spent: 40m (was: 0.5h)
> 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
> Priority: Major
> Labels: pull-request-available
> Attachments: example.txt
>
> Time Spent: 40m
> 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]