[jira] [Commented] (HDFS-3795) QJM: validate journal dir at startup
[ https://issues.apache.org/jira/browse/HDFS-3795?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13434326#comment-13434326 ] Aaron T. Myers commented on HDFS-3795: -- +1, the updated patch looks good to me. QJM: validate journal dir at startup Key: HDFS-3795 URL: https://issues.apache.org/jira/browse/HDFS-3795 Project: Hadoop HDFS Issue Type: Sub-task Components: ha Affects Versions: QuorumJournalManager (HDFS-3077) Reporter: Todd Lipcon Assignee: Todd Lipcon Priority: Minor Attachments: hdfs-3795.txt, hdfs-3795.txt Currently, the JN does not validate the configured journal directory until it tries to write into it. This is counter-intuitive for users, since they would expect to find out about a misconfiguration at startup time, rather than on first access. Additionally, two testers accidentally configured the journal dir to be a URI, which the code accidentally understood as a relative path ({{CWD/file:/foo/bar}}. We should validate the config at startup to be an accessible absolute path. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HDFS-3795) QJM: validate journal dir at startup
[ https://issues.apache.org/jira/browse/HDFS-3795?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13433773#comment-13433773 ] Aaron T. Myers commented on HDFS-3795: -- # Instead of !dir.getPath().startsWith(/) how about !dis.isAbsolute() ? # If the path is not a directory, this will fail with a misleading error message: {code} +if (!dir.isDirectory() !dir.mkdirs()) { + throw new IOException(Could not create journal dir ' + + dir + '); +} {code} Patch looks good otherwise. QJM: validate journal dir at startup Key: HDFS-3795 URL: https://issues.apache.org/jira/browse/HDFS-3795 Project: Hadoop HDFS Issue Type: Sub-task Components: ha Affects Versions: QuorumJournalManager (HDFS-3077) Reporter: Todd Lipcon Assignee: Todd Lipcon Priority: Minor Attachments: hdfs-3795.txt Currently, the JN does not validate the configured journal directory until it tries to write into it. This is counter-intuitive for users, since they would expect to find out about a misconfiguration at startup time, rather than on first access. Additionally, two testers accidentally configured the journal dir to be a URI, which the code accidentally understood as a relative path ({{CWD/file:/foo/bar}}. We should validate the config at startup to be an accessible absolute path. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira