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

Aaron T. Myers commented on HDFS-5709:
--------------------------------------

Patch looks pretty good to me. A few very small comments:

# I think this indentation is off:
{code}
+     // Rename .snapshot paths if we're doing an upgrade
+      parentPath = renameReservedPathsOnUpgrade(parentPath, getLayoutVersion(),
+          namesystem);
{code}
# I think we should consider scrapping the {{renameSnapshotPathChecked}} 
variable. Seems like it's just for efficiency, but in practice this code should 
only be triggered a relatively small number of times (since it only happens for 
path components containing the reserved string) and I think we can reasonably 
expect the JIT to take care of it, since it's really only checking conditions 
that will never change for the lifetime of the process. You might also consider 
moving the check that the replacement string doesn't contain the path separator 
to NN startup time, since you can reasonably check the validity of that config 
setting without there being any reserved names in the namespace.
# You might consider making FSNamesystem#renameSnapshotPath static so that you 
don't have to pass a reference to the FSNamesystem into the FSImageFormat 
methods.
# You should add some documentation about this setting to the snapshots docs.

> Improve upgrade with existing files and directories named ".snapshot"
> ---------------------------------------------------------------------
>
>                 Key: HDFS-5709
>                 URL: https://issues.apache.org/jira/browse/HDFS-5709
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: namenode
>    Affects Versions: 3.0.0, 2.2.0
>            Reporter: Andrew Wang
>            Assignee: Andrew Wang
>              Labels: snapshots, upgrade
>         Attachments: hdfs-5709-1.patch
>
>
> Right now in trunk, upgrade fails messily if the old fsimage or edits refer 
> to a directory named ".snapshot". We should at least print a better error 
> message (which I believe was the original intention in HDFS-4666), and [~atm] 
> proposed automatically renaming these files and directories.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to