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

Hudson commented on HDFS-8219:
------------------------------

SUCCESS: Integrated in Hadoop-Mapreduce-trunk-Java8 #186 (See 
[https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Java8/186/])
HDFS-8219. setStoragePolicy with folder behavior is different after cluster 
restart. (surendra singh lilhore via Xiaoyu Yao) (xyao: rev 
0100b155019496d077f958904de7d385697d65d9)
* 
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestBlockStoragePolicy.java
* 
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java
* hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt


> setStoragePolicy with folder behavior is different after cluster restart
> ------------------------------------------------------------------------
>
>                 Key: HDFS-8219
>                 URL: https://issues.apache.org/jira/browse/HDFS-8219
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: Peter Shi
>            Assignee: surendra singh lilhore
>              Labels: BB2015-05-RFC
>             Fix For: 2.8.0
>
>         Attachments: HDFS-8219.patch, HDFS-8219.unittest-norepro.patch
>
>
> Reproduce steps.
> 1) mkdir named /temp
> 2) put one file A under /temp
> 3) change /temp storage policy to COLD
> 4) use -getStoragePolicy to query file A's storage policy, it is same with 
> /temp
> 5) change /temp folder storage policy again, will see file A's storage policy 
> keep same with parent folder.
> then restart the cluster.
> do 3) 4) again, will find file A's storage policy is not change while parent 
> folder's storage policy changes. It behaves different.
> As i debugged, found the code:
> in INodeFile.getStoragePolicyID
> {code}
>   public byte getStoragePolicyID() {
>     byte id = getLocalStoragePolicyID();
>     if (id == BLOCK_STORAGE_POLICY_ID_UNSPECIFIED) {
>       return this.getParent() != null ?
>           this.getParent().getStoragePolicyID() : id;
>     }
>     return id;
>   }
> {code}
> If the file do not have its storage policy, it will use parent's. But after 
> cluster restart, the file turns to have its own storage policy.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to