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 2020/10/08 17:43:56 UTC

[GitHub] [hadoop] smengcl commented on a change in pull request #2370: HDFS-15614. Initialize snapshot trash root during NameNode startup if enabled

smengcl commented on a change in pull request #2370:
URL: https://github.com/apache/hadoop/pull/2370#discussion_r501900056



##########
File path: hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
##########
@@ -8524,6 +8530,39 @@ void checkAccess(String src, FsAction mode) throws IOException {
     logAuditEvent(true, operationName, src);
   }
 
+  /**
+   * Check if snapshot roots are created for all existing snapshottable
+   * directories. Create them if not.
+   */
+  void checkAndProvisionSnapshotTrashRoots() throws IOException {
+    if (haEnabled) {
+      if (!inActiveState()) {

Review comment:
       I am not 100% sure about this condition check. Any suggestions/confirmations?
   
   The goal is to only let **Active NN** to check and provision snapshot trash roots. The assumption is that the `mkdirs()` call below propagates the write to standby 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:
users@infra.apache.org



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