[ 
https://issues.apache.org/jira/browse/HDFS-15614?focusedWorklogId=497470&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-497470
 ]

ASF GitHub Bot logged work on HDFS-15614:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 08/Oct/20 17:43
            Start Date: 08/Oct/20 17:43
    Worklog Time Spent: 10m 
      Work Description: 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:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 497470)
    Time Spent: 20m  (was: 10m)

> Initialize snapshot trash root during NameNode startup if enabled
> -----------------------------------------------------------------
>
>                 Key: HDFS-15614
>                 URL: https://issues.apache.org/jira/browse/HDFS-15614
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>            Reporter: Siyao Meng
>            Assignee: Siyao Meng
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> This is a follow-up to HDFS-15607.
> Goal:
> Initialize (create) snapshot trash root for all existing snapshottable 
> directories if {{dfs.namenode.snapshot.trashroot.enabled}} is set to 
> {{true}}. So admins won't have to run {{dfsadmin -provisionTrash}} manually 
> on all those existing snapshottable directories.
> The change is expected to land in {{FSNamesystem}}.
> Discussion:
> 1. Currently in HDFS-15607, the snapshot trash root creation logic is on the 
> client side. But in order for NN to create it at startup, the logic must 
> (also) be implemented on the server side as well. -- which is also a 
> requirement by WebHDFS (HDFS-15612).
> 2. Alternatively, we can provide an extra parameter to the 
> {{-provisionTrash}} command like: {{dfsadmin -provisionTrash -all}} to 
> initialize/provision trash root on all existing snapshottable dirs.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to