You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2019/05/16 04:47:56 UTC

[GitHub] [hadoop] swagle commented on a change in pull request #822: HDDS-1527. HDDS Datanode start fails due to datanode.id file read error

swagle commented on a change in pull request #822: HDDS-1527. HDDS Datanode start fails due to datanode.id file read error
URL: https://github.com/apache/hadoop/pull/822#discussion_r284537726
 
 

 ##########
 File path: hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/helpers/ContainerUtils.java
 ##########
 @@ -221,8 +226,16 @@ public synchronized static DatanodeDetails readDatanodeDetailsFrom(File path)
     try {
       return DatanodeIdYaml.readDatanodeIdFile(path);
     } catch (IOException e) {
-      throw new IOException("Failed to parse DatanodeDetails from "
-          + path.getAbsolutePath(), e);
+      LOG.warn("Error loading DatanodeDetails yaml from " +
+          path.getAbsolutePath(), e);
+      // Try to load as protobuf before giving up
+      try (FileInputStream in = new FileInputStream(path)) {
 
 Review comment:
   Thanks for the review @xiaoyuyao, will gladly add the test.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org