bshashikant commented on a change in pull request #2370: URL: https://github.com/apache/hadoop/pull/2370#discussion_r502332901
########## File path: hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java ########## @@ -2031,6 +2033,10 @@ private String metaSaveAsString() { return sw.toString(); } + public boolean getIsSnapshotTrashRootEnabled() { Review comment: getIsSnapshotTrashRootEnabled --> isSnapshotTrashRootEnabled?? ########## File path: hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNode.java ########## @@ -781,6 +781,10 @@ protected void initialize(Configuration conf) throws IOException { } } + if (namesystem.getIsSnapshotTrashRootEnabled()) { Review comment: how about doing this here: @Override public void startActiveServices() throws IOException { try { namesystem.startActiveServices(); startTrashEmptier(getConf()); } catch (Throwable t) { doImmediateShutdown(t); } } Just before starting the trashEmptier thread. We don't need to check for Active or standby state here as these should be called in only Active NameNode. ########## File path: hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNode.java ########## @@ -781,6 +781,10 @@ protected void initialize(Configuration conf) throws IOException { } } + if (namesystem.getIsSnapshotTrashRootEnabled()) { Review comment: how about doing this here: ``` @Override public void startActiveServices() throws IOException { try { namesystem.startActiveServices(); startTrashEmptier(getConf()); } catch (Throwable t) { doImmediateShutdown(t); } } ``` just before starting the trashEmptier thread. We don't need to check for Active or standby state here as these should be called in only Active NameNode. ---------------------------------------------------------------- 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: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-issues-h...@hadoop.apache.org