[ https://issues.apache.org/jira/browse/HDDS-249?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16551108#comment-16551108 ]
Bharat Viswanadham edited comment on HDDS-249 at 7/20/18 6:33 PM: ------------------------------------------------------------------ Hi [~nandakumar131] Thanks for review. {quote}Line 198 & 190: {{hddsVolume.getHddsRootDir()}} can be replaced with {{hddsRoot}} {quote} Addressed it. {quote}Possible NullPointerException: Line:216 {{dnScmDir[0].getName()}}, this can throw NPE if HddsRootDir doesn't contain any directory but two files. {quote} Addressed in patch v07. {quote}In the below code, you don't need to have {{else}} structure as there is {{return}} statement inside {{if}} {quote} This is added because if any volume in hddsRootDir has greater than 2 files we want to fail that volume, as hddsRoot should always have Version and Scm dir. {quote} if (hddsFiles.length == 1) { if (scmDir.mkdir()) { return true; } logger.error("Unable to create scmDir {}", scmDir); } This code will not be true, if hddsFiles length is 1, as we just formatted it the file will be version file. So, this check should not be here. {quote} So, for checkVolume, I just retained the old code. Attached patch v08. was (Author: bharatviswa): Hi [~nandakumar131] Thanks for review. Line 198 & 190: {{hddsVolume.getHddsRootDir()}} can be replaced with {{hddsRoot}} Addressed it. Addressed in patch v07. In the below code, you don't need to have {{else}} structure as there is {{return}} statement inside {{if}} This is added because if any volume in hddsRootDir has greater than 2 files we want to fail that volume, as hddsRoot should always have Version and Scm dir. if (hddsFiles.length == 1) { if (scmDir.mkdir()) { return true; } logger.error("Unable to create scmDir {}", scmDir); } This code will not be true, if hddsFiles length is 1, as we just formatted it the file will be version file. So, this check should not be here. So, for checkVolume, I just retained the old code. Attached patch v08. > Fail if multiple SCM IDs on the DataNode and add SCM ID check after version > request > ----------------------------------------------------------------------------------- > > Key: HDDS-249 > URL: https://issues.apache.org/jira/browse/HDDS-249 > Project: Hadoop Distributed Data Store > Issue Type: Improvement > Reporter: Bharat Viswanadham > Assignee: Bharat Viswanadham > Priority: Major > Fix For: 0.2.1 > > Attachments: HDDS-249.00.patch, HDDS-249.01.patch, HDDS-249.02.patch, > HDDS-249.03.patch, HDDS-249.04.patch, HDDS-249.05.patch, HDDS-249.06.patch, > HDDS-249.07.patch, HDDS-249.08.patch > > > This Jira take care of following conditions: > # If multiple Scm directories exist on datanode, it fails that volume. > # validate SCMID response from SCM. -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org