[jira] [Updated] (HDFS-15563) Incorrect getTrashRoot return value when a non-snapshottable dir prefix matches the path of a snapshottable dir

2020-09-10 Thread Shashikant Banerjee (Jira)


 [ 
https://issues.apache.org/jira/browse/HDFS-15563?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Shashikant Banerjee updated HDFS-15563:
---
Resolution: Fixed
Status: Resolved  (was: Patch Available)

> Incorrect getTrashRoot return value when a non-snapshottable dir prefix 
> matches the path of a snapshottable dir
> ---
>
> Key: HDFS-15563
> URL: https://issues.apache.org/jira/browse/HDFS-15563
> Project: Hadoop HDFS
>  Issue Type: Sub-task
>  Components: snapshots
>Affects Versions: 3.4.0
>Reporter: Nilotpal Nandi
>Assignee: Siyao Meng
>Priority: Major
>  Labels: pull-request-available
> Fix For: 3.4.0
>
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Note: Only impacts a user if {{dfs.namenode.snapshot.trashroot.enabled}} is 
> enabled.
> Root cause analysis:
> {{SnapshottableDirectoryStatus}} paths retrived inside 
> {{DFSClient#getSnapshotRoot}} aren't appended with '/', causing some 
> directories with the same path prefix to be mistakenly classified as 
> snapshottable directory.
> Thanks [~shashikant] for the test case addition.
> ---
> Repro:
> {code:java}
> 1. snapshottable directory present in the cluster
> hdfs lsSnapshottableDir
> drwx-x-x 0 hrt_2 hrt_2 0 2020-09-08 07:42 0 65536 /user/hrt_2
> drwxr-xr-x 0 hrt_4 hrt_4 0 2020-09-08 13:16 0 65536 
> /user/hrt_4/newdir/subdir2. Created a new directory outside snapshottable 
> directory
> hdfs dfs -mkdir /user/hrt_4/newdir/subdir23. Tried to delete subdir2 , it 
> failed
> hdfs dfs -rm -r /user/hrt_4/newdir/subdir2
> rm: Failed to move to trash: hdfs://ns1/user/hrt_4/newdir/subdir2: Source 
> /user/hrt_4/newdir/subdir2 and dest 
> /user/hrt_4/newdir/subdir/.Trash/hdfs/Current/user/hrt_4/newdir/subdir2 are 
> not under the same snapshot root.
> {code}
> "*/user/hrt_4/newdir/subdir2*" , the trash root location is coming to be 
> "*/user/hrt_4/newdir/subdir/.Trash*"
> as clear from the msg here:
> {noformat}
> rm: Failed to move to trash: hdfs://ns1/user/hrt_4/newdir/subdir2: Source 
> /user/hrt_4/newdir/subdir2 and dest 
> /user/hrt_4/newdir/subdir/.Trash/hdfs/Current/user/hrt_4/newdir/subdir2 are 
> not under the same snapshot root.{noformat}



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

-
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org



[jira] [Updated] (HDFS-15563) Incorrect getTrashRoot return value when a non-snapshottable dir prefix matches the path of a snapshottable dir

2020-09-09 Thread Siyao Meng (Jira)


 [ 
https://issues.apache.org/jira/browse/HDFS-15563?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Siyao Meng updated HDFS-15563:
--
Description: 
Note: Only impacts a user if {{dfs.namenode.snapshot.trashroot.enabled}} is 
enabled.

Root cause analysis:

{{SnapshottableDirectoryStatus}} paths retrived inside 
{{DFSClient#getSnapshotRoot}} aren't appended with '/', causing some 
directories with the same path prefix to be mistakenly classified as 
snapshottable directory.

Thanks [~shashikant] for the test case addition.

---

Repro:

{code:java}
1. snapshottable directory present in the cluster
hdfs lsSnapshottableDir
drwx-x-x 0 hrt_2 hrt_2 0 2020-09-08 07:42 0 65536 /user/hrt_2
drwxr-xr-x 0 hrt_4 hrt_4 0 2020-09-08 13:16 0 65536 /user/hrt_4/newdir/subdir2. 
Created a new directory outside snapshottable directory
hdfs dfs -mkdir /user/hrt_4/newdir/subdir23. Tried to delete subdir2 , it failed
hdfs dfs -rm -r /user/hrt_4/newdir/subdir2
rm: Failed to move to trash: hdfs://ns1/user/hrt_4/newdir/subdir2: Source 
/user/hrt_4/newdir/subdir2 and dest 
/user/hrt_4/newdir/subdir/.Trash/hdfs/Current/user/hrt_4/newdir/subdir2 are not 
under the same snapshot root.
{code}
"*/user/hrt_4/newdir/subdir2*" , the trash root location is coming to be 
"*/user/hrt_4/newdir/subdir/.Trash*"

as clear from the msg here:
{noformat}
rm: Failed to move to trash: hdfs://ns1/user/hrt_4/newdir/subdir2: Source 
/user/hrt_4/newdir/subdir2 and dest 
/user/hrt_4/newdir/subdir/.Trash/hdfs/Current/user/hrt_4/newdir/subdir2 are not 
under the same snapshot root.{noformat}

  was:
Note: Only impacts a user if {{dfs.namenode.snapshot.trashroot.enabled}} is 
enabled.

Root cause analysis:

{{DFSClient#getSnapshotRoot}} check loop 

Thanks [~shashikant] for the test case addition.

---

Repro:

{code:java}
1. snapshottable directory present in the cluster
hdfs lsSnapshottableDir
drwx-x-x 0 hrt_2 hrt_2 0 2020-09-08 07:42 0 65536 /user/hrt_2
drwxr-xr-x 0 hrt_4 hrt_4 0 2020-09-08 13:16 0 65536 /user/hrt_4/newdir/subdir2. 
Created a new directory outside snapshottable directory
hdfs dfs -mkdir /user/hrt_4/newdir/subdir23. Tried to delete subdir2 , it failed
hdfs dfs -rm -r /user/hrt_4/newdir/subdir2
rm: Failed to move to trash: hdfs://ns1/user/hrt_4/newdir/subdir2: Source 
/user/hrt_4/newdir/subdir2 and dest 
/user/hrt_4/newdir/subdir/.Trash/hdfs/Current/user/hrt_4/newdir/subdir2 are not 
under the same snapshot root.
{code}
"*/user/hrt_4/newdir/subdir2*" , the trash root location is coming to be 
"*/user/hrt_4/newdir/subdir/.Trash*"

as clear from the msg here:
{noformat}
rm: Failed to move to trash: hdfs://ns1/user/hrt_4/newdir/subdir2: Source 
/user/hrt_4/newdir/subdir2 and dest 
/user/hrt_4/newdir/subdir/.Trash/hdfs/Current/user/hrt_4/newdir/subdir2 are not 
under the same snapshot root.{noformat}


> Incorrect getTrashRoot return value when a non-snapshottable dir prefix 
> matches the path of a snapshottable dir
> ---
>
> Key: HDFS-15563
> URL: https://issues.apache.org/jira/browse/HDFS-15563
> Project: Hadoop HDFS
>  Issue Type: Sub-task
>  Components: snapshots
>Affects Versions: 3.4.0
>Reporter: Nilotpal Nandi
>Assignee: Siyao Meng
>Priority: Major
>  Labels: pull-request-available
> Fix For: 3.4.0
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> Note: Only impacts a user if {{dfs.namenode.snapshot.trashroot.enabled}} is 
> enabled.
> Root cause analysis:
> {{SnapshottableDirectoryStatus}} paths retrived inside 
> {{DFSClient#getSnapshotRoot}} aren't appended with '/', causing some 
> directories with the same path prefix to be mistakenly classified as 
> snapshottable directory.
> Thanks [~shashikant] for the test case addition.
> ---
> Repro:
> {code:java}
> 1. snapshottable directory present in the cluster
> hdfs lsSnapshottableDir
> drwx-x-x 0 hrt_2 hrt_2 0 2020-09-08 07:42 0 65536 /user/hrt_2
> drwxr-xr-x 0 hrt_4 hrt_4 0 2020-09-08 13:16 0 65536 
> /user/hrt_4/newdir/subdir2. Created a new directory outside snapshottable 
> directory
> hdfs dfs -mkdir /user/hrt_4/newdir/subdir23. Tried to delete subdir2 , it 
> failed
> hdfs dfs -rm -r /user/hrt_4/newdir/subdir2
> rm: Failed to move to trash: hdfs://ns1/user/hrt_4/newdir/subdir2: Source 
> /user/hrt_4/newdir/subdir2 and dest 
> /user/hrt_4/newdir/subdir/.Trash/hdfs/Current/user/hrt_4/newdir/subdir2 are 
> not under the same snapshot root.
> {code}
> "*/user/hrt_4/newdir/subdir2*" , the trash root location is coming to be 
> "*/user/hrt_4/newdir/subdir/.Trash*"
> as clear from the msg here:
> {noformat}
> rm: Failed to move to trash: hdfs://ns1/user/hrt_4/newdir/subdir2: Source 
> /user/hrt_4/newdir/subdir2 and dest 
> 

[jira] [Updated] (HDFS-15563) Incorrect getTrashRoot return value when a non-snapshottable dir prefix matches the path of a snapshottable dir

2020-09-09 Thread Siyao Meng (Jira)


 [ 
https://issues.apache.org/jira/browse/HDFS-15563?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Siyao Meng updated HDFS-15563:
--
Status: Patch Available  (was: Open)

> Incorrect getTrashRoot return value when a non-snapshottable dir prefix 
> matches the path of a snapshottable dir
> ---
>
> Key: HDFS-15563
> URL: https://issues.apache.org/jira/browse/HDFS-15563
> Project: Hadoop HDFS
>  Issue Type: Sub-task
>  Components: snapshots
>Affects Versions: 3.4.0
>Reporter: Nilotpal Nandi
>Assignee: Siyao Meng
>Priority: Major
> Fix For: 3.4.0
>
>
> Note: Only impacts a user if {{dfs.namenode.snapshot.trashroot.enabled}} is 
> enabled.
> Root cause analysis:
> {{DFSClient#getSnapshotRoot}} check loop 
> Thanks [~shashikant] for the test case addition.
> ---
> Repro:
> {code:java}
> 1. snapshottable directory present in the cluster
> hdfs lsSnapshottableDir
> drwx-x-x 0 hrt_2 hrt_2 0 2020-09-08 07:42 0 65536 /user/hrt_2
> drwxr-xr-x 0 hrt_4 hrt_4 0 2020-09-08 13:16 0 65536 
> /user/hrt_4/newdir/subdir2. Created a new directory outside snapshottable 
> directory
> hdfs dfs -mkdir /user/hrt_4/newdir/subdir23. Tried to delete subdir2 , it 
> failed
> hdfs dfs -rm -r /user/hrt_4/newdir/subdir2
> rm: Failed to move to trash: hdfs://ns1/user/hrt_4/newdir/subdir2: Source 
> /user/hrt_4/newdir/subdir2 and dest 
> /user/hrt_4/newdir/subdir/.Trash/hdfs/Current/user/hrt_4/newdir/subdir2 are 
> not under the same snapshot root.
> {code}
> "*/user/hrt_4/newdir/subdir2*" , the trash root location is coming to be 
> "*/user/hrt_4/newdir/subdir/.Trash*"
> as clear from the msg here:
> {noformat}
> rm: Failed to move to trash: hdfs://ns1/user/hrt_4/newdir/subdir2: Source 
> /user/hrt_4/newdir/subdir2 and dest 
> /user/hrt_4/newdir/subdir/.Trash/hdfs/Current/user/hrt_4/newdir/subdir2 are 
> not under the same snapshot root.{noformat}



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

-
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org



[jira] [Updated] (HDFS-15563) Incorrect getTrashRoot return value when a non-snapshottable dir prefix matches the path of a snapshottable dir

2020-09-09 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HDFS-15563?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

ASF GitHub Bot updated HDFS-15563:
--
Labels: pull-request-available  (was: )

> Incorrect getTrashRoot return value when a non-snapshottable dir prefix 
> matches the path of a snapshottable dir
> ---
>
> Key: HDFS-15563
> URL: https://issues.apache.org/jira/browse/HDFS-15563
> Project: Hadoop HDFS
>  Issue Type: Sub-task
>  Components: snapshots
>Affects Versions: 3.4.0
>Reporter: Nilotpal Nandi
>Assignee: Siyao Meng
>Priority: Major
>  Labels: pull-request-available
> Fix For: 3.4.0
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> Note: Only impacts a user if {{dfs.namenode.snapshot.trashroot.enabled}} is 
> enabled.
> Root cause analysis:
> {{DFSClient#getSnapshotRoot}} check loop 
> Thanks [~shashikant] for the test case addition.
> ---
> Repro:
> {code:java}
> 1. snapshottable directory present in the cluster
> hdfs lsSnapshottableDir
> drwx-x-x 0 hrt_2 hrt_2 0 2020-09-08 07:42 0 65536 /user/hrt_2
> drwxr-xr-x 0 hrt_4 hrt_4 0 2020-09-08 13:16 0 65536 
> /user/hrt_4/newdir/subdir2. Created a new directory outside snapshottable 
> directory
> hdfs dfs -mkdir /user/hrt_4/newdir/subdir23. Tried to delete subdir2 , it 
> failed
> hdfs dfs -rm -r /user/hrt_4/newdir/subdir2
> rm: Failed to move to trash: hdfs://ns1/user/hrt_4/newdir/subdir2: Source 
> /user/hrt_4/newdir/subdir2 and dest 
> /user/hrt_4/newdir/subdir/.Trash/hdfs/Current/user/hrt_4/newdir/subdir2 are 
> not under the same snapshot root.
> {code}
> "*/user/hrt_4/newdir/subdir2*" , the trash root location is coming to be 
> "*/user/hrt_4/newdir/subdir/.Trash*"
> as clear from the msg here:
> {noformat}
> rm: Failed to move to trash: hdfs://ns1/user/hrt_4/newdir/subdir2: Source 
> /user/hrt_4/newdir/subdir2 and dest 
> /user/hrt_4/newdir/subdir/.Trash/hdfs/Current/user/hrt_4/newdir/subdir2 are 
> not under the same snapshot root.{noformat}



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

-
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org



[jira] [Updated] (HDFS-15563) Incorrect getTrashRoot return value when a non-snapshottable dir prefix matches the path of a snapshottable dir

2020-09-09 Thread Siyao Meng (Jira)


 [ 
https://issues.apache.org/jira/browse/HDFS-15563?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Siyao Meng updated HDFS-15563:
--
Description: 
Note: Only impacts a user if {{dfs.namenode.snapshot.trashroot.enabled}} is 
enabled.

Root cause analysis:

{{DFSClient#getSnapshotRoot}} check loop 

Thanks [~shashikant] for the test case addition.

---

Repro:

{code:java}
1. snapshottable directory present in the cluster
hdfs lsSnapshottableDir
drwx-x-x 0 hrt_2 hrt_2 0 2020-09-08 07:42 0 65536 /user/hrt_2
drwxr-xr-x 0 hrt_4 hrt_4 0 2020-09-08 13:16 0 65536 /user/hrt_4/newdir/subdir2. 
Created a new directory outside snapshottable directory
hdfs dfs -mkdir /user/hrt_4/newdir/subdir23. Tried to delete subdir2 , it failed
hdfs dfs -rm -r /user/hrt_4/newdir/subdir2
rm: Failed to move to trash: hdfs://ns1/user/hrt_4/newdir/subdir2: Source 
/user/hrt_4/newdir/subdir2 and dest 
/user/hrt_4/newdir/subdir/.Trash/hdfs/Current/user/hrt_4/newdir/subdir2 are not 
under the same snapshot root.
{code}
"*/user/hrt_4/newdir/subdir2*" , the trash root location is coming to be 
"*/user/hrt_4/newdir/subdir/.Trash*"

as clear from the msg here:
{noformat}
rm: Failed to move to trash: hdfs://ns1/user/hrt_4/newdir/subdir2: Source 
/user/hrt_4/newdir/subdir2 and dest 
/user/hrt_4/newdir/subdir/.Trash/hdfs/Current/user/hrt_4/newdir/subdir2 are not 
under the same snapshot root.{noformat}

  was:
Note: Only impacts a user if {{dfs.namenode.snapshot.trashroot.enabled}} is 
enabled.

Root cause analysis:

DFSClient#getSnapshotRoot

Thanks [~shashikant] for the test case addition.

---

Repro:

{code:java}
1. snapshottable directory present in the cluster
hdfs lsSnapshottableDir
drwx-x-x 0 hrt_2 hrt_2 0 2020-09-08 07:42 0 65536 /user/hrt_2
drwxr-xr-x 0 hrt_4 hrt_4 0 2020-09-08 13:16 0 65536 /user/hrt_4/newdir/subdir2. 
Created a new directory outside snapshottable directory
hdfs dfs -mkdir /user/hrt_4/newdir/subdir23. Tried to delete subdir2 , it failed
hdfs dfs -rm -r /user/hrt_4/newdir/subdir2
rm: Failed to move to trash: hdfs://ns1/user/hrt_4/newdir/subdir2: Source 
/user/hrt_4/newdir/subdir2 and dest 
/user/hrt_4/newdir/subdir/.Trash/hdfs/Current/user/hrt_4/newdir/subdir2 are not 
under the same snapshot root.
{code}
"*/user/hrt_4/newdir/subdir2*" , the trash root location is coming to be 
"*/user/hrt_4/newdir/subdir/.Trash*"

as clear from the msg here:
{noformat}
rm: Failed to move to trash: hdfs://ns1/user/hrt_4/newdir/subdir2: Source 
/user/hrt_4/newdir/subdir2 and dest 
/user/hrt_4/newdir/subdir/.Trash/hdfs/Current/user/hrt_4/newdir/subdir2 are not 
under the same snapshot root.{noformat}


> Incorrect getTrashRoot return value when a non-snapshottable dir prefix 
> matches the path of a snapshottable dir
> ---
>
> Key: HDFS-15563
> URL: https://issues.apache.org/jira/browse/HDFS-15563
> Project: Hadoop HDFS
>  Issue Type: Sub-task
>  Components: snapshots
>Affects Versions: 3.4.0
>Reporter: Nilotpal Nandi
>Assignee: Siyao Meng
>Priority: Major
> Fix For: 3.4.0
>
>
> Note: Only impacts a user if {{dfs.namenode.snapshot.trashroot.enabled}} is 
> enabled.
> Root cause analysis:
> {{DFSClient#getSnapshotRoot}} check loop 
> Thanks [~shashikant] for the test case addition.
> ---
> Repro:
> {code:java}
> 1. snapshottable directory present in the cluster
> hdfs lsSnapshottableDir
> drwx-x-x 0 hrt_2 hrt_2 0 2020-09-08 07:42 0 65536 /user/hrt_2
> drwxr-xr-x 0 hrt_4 hrt_4 0 2020-09-08 13:16 0 65536 
> /user/hrt_4/newdir/subdir2. Created a new directory outside snapshottable 
> directory
> hdfs dfs -mkdir /user/hrt_4/newdir/subdir23. Tried to delete subdir2 , it 
> failed
> hdfs dfs -rm -r /user/hrt_4/newdir/subdir2
> rm: Failed to move to trash: hdfs://ns1/user/hrt_4/newdir/subdir2: Source 
> /user/hrt_4/newdir/subdir2 and dest 
> /user/hrt_4/newdir/subdir/.Trash/hdfs/Current/user/hrt_4/newdir/subdir2 are 
> not under the same snapshot root.
> {code}
> "*/user/hrt_4/newdir/subdir2*" , the trash root location is coming to be 
> "*/user/hrt_4/newdir/subdir/.Trash*"
> as clear from the msg here:
> {noformat}
> rm: Failed to move to trash: hdfs://ns1/user/hrt_4/newdir/subdir2: Source 
> /user/hrt_4/newdir/subdir2 and dest 
> /user/hrt_4/newdir/subdir/.Trash/hdfs/Current/user/hrt_4/newdir/subdir2 are 
> not under the same snapshot root.{noformat}



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

-
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org



[jira] [Updated] (HDFS-15563) Incorrect getTrashRoot return value when a non-snapshottable dir prefix matches the path of a snapshottable dir

2020-09-09 Thread Siyao Meng (Jira)


 [ 
https://issues.apache.org/jira/browse/HDFS-15563?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Siyao Meng updated HDFS-15563:
--
Description: 
Note: Only impacts a user if {{dfs.namenode.snapshot.trashroot.enabled}} is 
enabled.

Root cause analysis:

DFSClient#getSnapshotRoot

Thanks [~shashikant] for the test case addition.

---

Repro:

{code:java}
1. snapshottable directory present in the cluster
hdfs lsSnapshottableDir
drwx-x-x 0 hrt_2 hrt_2 0 2020-09-08 07:42 0 65536 /user/hrt_2
drwxr-xr-x 0 hrt_4 hrt_4 0 2020-09-08 13:16 0 65536 /user/hrt_4/newdir/subdir2. 
Created a new directory outside snapshottable directory
hdfs dfs -mkdir /user/hrt_4/newdir/subdir23. Tried to delete subdir2 , it failed
hdfs dfs -rm -r /user/hrt_4/newdir/subdir2
rm: Failed to move to trash: hdfs://ns1/user/hrt_4/newdir/subdir2: Source 
/user/hrt_4/newdir/subdir2 and dest 
/user/hrt_4/newdir/subdir/.Trash/hdfs/Current/user/hrt_4/newdir/subdir2 are not 
under the same snapshot root.
{code}
"*/user/hrt_4/newdir/subdir2*" , the trash root location is coming to be 
"*/user/hrt_4/newdir/subdir/.Trash*"

as clear from the msg here:
{noformat}
rm: Failed to move to trash: hdfs://ns1/user/hrt_4/newdir/subdir2: Source 
/user/hrt_4/newdir/subdir2 and dest 
/user/hrt_4/newdir/subdir/.Trash/hdfs/Current/user/hrt_4/newdir/subdir2 are not 
under the same snapshot root.{noformat}

  was:
{code:java}
1. snapshottable directory present in the cluster
hdfs lsSnapshottableDir
drwx-x-x 0 hrt_2 hrt_2 0 2020-09-08 07:42 0 65536 /user/hrt_2
drwxr-xr-x 0 hrt_4 hrt_4 0 2020-09-08 13:16 0 65536 /user/hrt_4/newdir/subdir2. 
Created a new directory outside snapshottable directory
hdfs dfs -mkdir /user/hrt_4/newdir/subdir23. Tried to delete subdir2 , it failed
hdfs dfs -rm -r /user/hrt_4/newdir/subdir2
rm: Failed to move to trash: hdfs://ns1/user/hrt_4/newdir/subdir2: Source 
/user/hrt_4/newdir/subdir2 and dest 
/user/hrt_4/newdir/subdir/.Trash/hdfs/Current/user/hrt_4/newdir/subdir2 are not 
under the same snapshot root.
{code}
"*/user/hrt_4/newdir/subdir2*" , the trash root location is coming to be 
"*/user/hrt_4/newdir/subdir/.Trash*"

as clear from the msg here:
{noformat}
rm: Failed to move to trash: hdfs://ns1/user/hrt_4/newdir/subdir2: Source 
/user/hrt_4/newdir/subdir2 and dest 
/user/hrt_4/newdir/subdir/.Trash/hdfs/Current/user/hrt_4/newdir/subdir2 are not 
under the same snapshot root.{noformat}


> Incorrect getTrashRoot return value when a non-snapshottable dir prefix 
> matches the path of a snapshottable dir
> ---
>
> Key: HDFS-15563
> URL: https://issues.apache.org/jira/browse/HDFS-15563
> Project: Hadoop HDFS
>  Issue Type: Sub-task
>  Components: snapshots
>Affects Versions: 3.4.0
>Reporter: Nilotpal Nandi
>Assignee: Siyao Meng
>Priority: Major
> Fix For: 3.4.0
>
>
> Note: Only impacts a user if {{dfs.namenode.snapshot.trashroot.enabled}} is 
> enabled.
> Root cause analysis:
> DFSClient#getSnapshotRoot
> Thanks [~shashikant] for the test case addition.
> ---
> Repro:
> {code:java}
> 1. snapshottable directory present in the cluster
> hdfs lsSnapshottableDir
> drwx-x-x 0 hrt_2 hrt_2 0 2020-09-08 07:42 0 65536 /user/hrt_2
> drwxr-xr-x 0 hrt_4 hrt_4 0 2020-09-08 13:16 0 65536 
> /user/hrt_4/newdir/subdir2. Created a new directory outside snapshottable 
> directory
> hdfs dfs -mkdir /user/hrt_4/newdir/subdir23. Tried to delete subdir2 , it 
> failed
> hdfs dfs -rm -r /user/hrt_4/newdir/subdir2
> rm: Failed to move to trash: hdfs://ns1/user/hrt_4/newdir/subdir2: Source 
> /user/hrt_4/newdir/subdir2 and dest 
> /user/hrt_4/newdir/subdir/.Trash/hdfs/Current/user/hrt_4/newdir/subdir2 are 
> not under the same snapshot root.
> {code}
> "*/user/hrt_4/newdir/subdir2*" , the trash root location is coming to be 
> "*/user/hrt_4/newdir/subdir/.Trash*"
> as clear from the msg here:
> {noformat}
> rm: Failed to move to trash: hdfs://ns1/user/hrt_4/newdir/subdir2: Source 
> /user/hrt_4/newdir/subdir2 and dest 
> /user/hrt_4/newdir/subdir/.Trash/hdfs/Current/user/hrt_4/newdir/subdir2 are 
> not under the same snapshot root.{noformat}



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

-
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org



[jira] [Updated] (HDFS-15563) Incorrect getTrashRoot return value when a non-snapshottable dir prefix matches the path of a snapshottable dir

2020-09-09 Thread Siyao Meng (Jira)


 [ 
https://issues.apache.org/jira/browse/HDFS-15563?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Siyao Meng updated HDFS-15563:
--
Summary: Incorrect getTrashRoot return value when a non-snapshottable dir 
prefix matches the path of a snapshottable dir  (was: getTrashRoot() location 
can be wrong when the non-snapshottable directory contains the name of the 
snapshottable directory in its name )

> Incorrect getTrashRoot return value when a non-snapshottable dir prefix 
> matches the path of a snapshottable dir
> ---
>
> Key: HDFS-15563
> URL: https://issues.apache.org/jira/browse/HDFS-15563
> Project: Hadoop HDFS
>  Issue Type: Sub-task
>  Components: snapshots
>Affects Versions: 3.4.0
>Reporter: Nilotpal Nandi
>Assignee: Siyao Meng
>Priority: Major
> Fix For: 3.4.0
>
>
> {code:java}
> 1. snapshottable directory present in the cluster
> hdfs lsSnapshottableDir
> drwx-x-x 0 hrt_2 hrt_2 0 2020-09-08 07:42 0 65536 /user/hrt_2
> drwxr-xr-x 0 hrt_4 hrt_4 0 2020-09-08 13:16 0 65536 
> /user/hrt_4/newdir/subdir2. Created a new directory outside snapshottable 
> directory
> hdfs dfs -mkdir /user/hrt_4/newdir/subdir23. Tried to delete subdir2 , it 
> failed
> hdfs dfs -rm -r /user/hrt_4/newdir/subdir2
> rm: Failed to move to trash: hdfs://ns1/user/hrt_4/newdir/subdir2: Source 
> /user/hrt_4/newdir/subdir2 and dest 
> /user/hrt_4/newdir/subdir/.Trash/hdfs/Current/user/hrt_4/newdir/subdir2 are 
> not under the same snapshot root.
> {code}
> "*/user/hrt_4/newdir/subdir2*" , the trash root location is coming to be 
> "*/user/hrt_4/newdir/subdir/.Trash*"
> as clear from the msg here:
> {noformat}
> rm: Failed to move to trash: hdfs://ns1/user/hrt_4/newdir/subdir2: Source 
> /user/hrt_4/newdir/subdir2 and dest 
> /user/hrt_4/newdir/subdir/.Trash/hdfs/Current/user/hrt_4/newdir/subdir2 are 
> not under the same snapshot root.{noformat}



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

-
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org