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

Hudson commented on HDFS-14028:
-------------------------------

SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #15328 (See 
[https://builds.apache.org/job/Hadoop-trunk-Commit/15328/])
HDFS-14028. HDFS OIV temporary dir deletes folder. Contributed by Adam 
(aengineer: rev 4f10d7e23fc0b757a9e94bc448187a6211b90f10)
* (edit) 
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/TestOfflineImageViewer.java
* (edit) 
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/PBImageTextWriter.java


> HDFS OIV temporary dir deletes folder
> -------------------------------------
>
>                 Key: HDFS-14028
>                 URL: https://issues.apache.org/jira/browse/HDFS-14028
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: hdfs
>            Reporter: Adam Antal
>            Assignee: Adam Antal
>            Priority: Major
>             Fix For: 3.2.0, 3.0.4, 3.1.2, 3.3.0
>
>         Attachments: HDFS-14028.001.patch
>
>
> The Hadoop Offline Image Viewer tool has an undocumented 'feature' where it 
> will silently delete the directory passed in with the -t flag. This blew away 
> some important files when someone used a sensible, but ultimately poor choice 
> for this directory as the deletion isn't documented.
> For example, if someone were, as root do: 'hdfs oiv -i 
> fsimage_00000000000307052343 -p Delimited -t / -o image', bad things would 
> happen. This behavior should be documented and probably have a dialog or 
> throwing exception.
> There is a piece of code from PBImageTextWriter where a check can be added:
> {code:java}
> LevelDBMetadataMap(String baseDir) throws IOException {
>   File dbDir = new File(baseDir);
>   if (dbDir.exists()) {
>     FileUtils.deleteDirectory(dbDir);
>   }
>   ...
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to