HDFS-12485. expunge may fail to remove trash from encryption zone. Contributed by Wei-Chiu Chuang.
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/8dbc8909 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/8dbc8909 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/8dbc8909 Branch: refs/heads/YARN-1011 Commit: 8dbc8909c92d502d10a7f94d1de3171878a43b04 Parents: 21bc855 Author: Wei-Chiu Chuang <weic...@apache.org> Authored: Mon Oct 16 12:57:48 2017 -0700 Committer: Wei-Chiu Chuang <weic...@apache.org> Committed: Mon Oct 16 12:57:48 2017 -0700 ---------------------------------------------------------------------- .../main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java | 3 +-- .../apache/hadoop/hdfs/TestTrashWithSecureEncryptionZones.java | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/8dbc8909/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java index c9f4490..a8a5cfa 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java +++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java @@ -2783,8 +2783,7 @@ public class DistributedFileSystem extends FileSystem { } } } else { - Path userTrash = new Path(ezTrashRoot, System.getProperty( - "user.name")); + Path userTrash = new Path(ezTrashRoot, dfs.ugi.getShortUserName()); try { ret.add(getFileStatus(userTrash)); } catch (FileNotFoundException ignored) { http://git-wip-us.apache.org/repos/asf/hadoop/blob/8dbc8909/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestTrashWithSecureEncryptionZones.java ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestTrashWithSecureEncryptionZones.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestTrashWithSecureEncryptionZones.java index 314adfb..a8e2a71 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestTrashWithSecureEncryptionZones.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestTrashWithSecureEncryptionZones.java @@ -225,7 +225,6 @@ public class TestTrashWithSecureEncryptionZones { clientConf = new Configuration(conf); clientConf.setLong(FS_TRASH_INTERVAL_KEY, 1); shell = new FsShell(clientConf); - System.setProperty("user.name", HDFS_USER_NAME); } @AfterClass --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-commits-h...@hadoop.apache.org