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/11/19 01:40:56 UTC
[GitHub] [hadoop] smengcl commented on a change in pull request #2472: HDFS-15689. allow/disallowSnapshot on EZ roots shouldn't fail due to trash provisioning/emptiness check
smengcl commented on a change in pull request #2472:
URL: https://github.com/apache/hadoop/pull/2472#discussion_r526536143
##########
File path: hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/client/HdfsAdmin.java
##########
@@ -171,7 +174,15 @@ public void clearQuotaByStorageType(Path src, StorageType type) throws IOExcepti
public void allowSnapshot(Path path) throws IOException {
dfs.allowSnapshot(path);
if (dfs.isSnapshotTrashRootEnabled()) {
- dfs.provisionSnapshotTrash(path, TRASH_PERMISSION);
+ try {
+ dfs.provisionSnapshotTrash(path, TRASH_PERMISSION);
+ } catch (FileAlreadyExistsException ex) {
+ // Don't throw on FileAlreadyExistsException since it is likely due to
+ // admin allowing snapshot on an EZ root.
+ LOG.warn(ex.getMessage());
Review comment:
Thanks @bshashikant for the comment.
I was intending to not change the behavior of `DFS#provisionSnapshotTrash` but as I think again changing it should be fine since 3.4.0 is not released yet.
I will update the PR a bit later.
----------------------------------------------------------------
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