Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-12484

Undefined -expunge behavior after 2.8

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Patch Available
    • Major
    • Resolution: Unresolved
    • 2.8.0, 3.0.0-alpha1
    • None
    • fs
    • None

    Description

      (Rewrote the description to reflect the actual behavior)
      Hadoop 2.8 added a feature to support trash inside encryption zones, which is a great feature to have.

      However, when it comes to -expunge, the behavior is not well defined. A superuser invoking -expunge removes files under all encryption zone trash directory belonging to the user. On the other hand, because listEncryptionZones requires superuser permission, a non-privileged user invoking -expunge can removes under home directory, but not under encryption zones.

      Moreover, the command prints a scary warning message that looks annoying.

      2017-09-21 01:22:44,744 [main] WARN  hdfs.DFSClient (DistributedFileSystem.java:getTrashRoots(2795)) - Cannot get all encrypted trash roots
      org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.security.AccessControlException): Access denied for user user. Superuser privilege is required
      	at org.apache.hadoop.hdfs.server.namenode.FSPermissionChecker.checkSuperuserPrivilege(FSPermissionChecker.java:130)
      	at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.checkSuperuserPrivilege(FSNamesystem.java:4556)
      	at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.listEncryptionZones(FSNamesystem.java:7048)
      	at org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.listEncryptionZones(NameNodeRpcServer.java:2053)
      	at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolServerSideTranslatorPB.listEncryptionZones(ClientNamenodeProtocolServerSideTranslatorPB.java:1477)
      	at org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos$ClientNamenodeProtocol$2.callBlockingMethod(ClientNamenodeProtocolProtos.java)
      	at org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:523)
      	at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:991)
      	at org.apache.hadoop.ipc.Server$RpcCall.run(Server.java:869)
      	at org.apache.hadoop.ipc.Server$RpcCall.run(Server.java:815)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at javax.security.auth.Subject.doAs(Subject.java:422)
      	at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1962)
      	at org.apache.hadoop.ipc.Server$Handler.run(Server.java:2675)
      
      	at org.apache.hadoop.ipc.Client.getRpcResponse(Client.java:1490)
      	at org.apache.hadoop.ipc.Client.call(Client.java:1436)
      	at org.apache.hadoop.ipc.Client.call(Client.java:1346)
      	at org.apache.hadoop.ipc.ProtobufRpcEngine$Invoker.invoke(ProtobufRpcEngine.java:228)
      	at org.apache.hadoop.ipc.ProtobufRpcEngine$Invoker.invoke(ProtobufRpcEngine.java:116)
      	at com.sun.proxy.$Proxy25.listEncryptionZones(Unknown Source)
      	at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.listEncryptionZones(ClientNamenodeProtocolTranslatorPB.java:1510)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:422)
      	at org.apache.hadoop.io.retry.RetryInvocationHandler$Call.invokeMethod(RetryInvocationHandler.java:165)
      	at org.apache.hadoop.io.retry.RetryInvocationHandler$Call.invoke(RetryInvocationHandler.java:157)
      	at org.apache.hadoop.io.retry.RetryInvocationHandler$Call.invokeOnce(RetryInvocationHandler.java:95)
      	at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:359)
      	at com.sun.proxy.$Proxy29.listEncryptionZones(Unknown Source)
      	at org.apache.hadoop.hdfs.protocol.EncryptionZoneIterator.makeRequest(EncryptionZoneIterator.java:51)
      	at org.apache.hadoop.hdfs.protocol.EncryptionZoneIterator.makeRequest(EncryptionZoneIterator.java:33)
      	at org.apache.hadoop.fs.BatchedRemoteIterator.makeRequest(BatchedRemoteIterator.java:77)
      	at org.apache.hadoop.fs.BatchedRemoteIterator.makeRequestIfNeeded(BatchedRemoteIterator.java:85)
      	at org.apache.hadoop.fs.BatchedRemoteIterator.hasNext(BatchedRemoteIterator.java:99)
      	at org.apache.hadoop.hdfs.DistributedFileSystem.getTrashRoots(DistributedFileSystem.java:2773)
      	at org.apache.hadoop.fs.TrashPolicyDefault.deleteCheckpoint(TrashPolicyDefault.java:196)
      	at org.apache.hadoop.fs.Trash.expunge(Trash.java:120)
      	at org.apache.hadoop.fs.shell.Delete$Expunge.processArguments(Delete.java:247)
      	at org.apache.hadoop.fs.shell.FsCommand.processRawArguments(FsCommand.java:119)
      	at org.apache.hadoop.fs.shell.Command.run(Command.java:176)
      	at org.apache.hadoop.fs.FsShell.run(FsShell.java:326)
      

      Attachments

        1. HDFS-12484.001.patch
          3 kB
          Wei-Chiu Chuang
        2. HDFS-12484.002.patch
          5 kB
          Wei-Chiu Chuang

        Issue Links

          Activity

            People

              Unassigned Unassigned
              weichiu Wei-Chiu Chuang
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated: