openinx commented on a change in pull request #440: HBASE-22776 Rename config 
names in user scan snapshot feature
URL: https://github.com/apache/hbase/pull/440#discussion_r310865092
 
 

 ##########
 File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/SnapshotScannerHDFSAclController.java
 ##########
 @@ -290,17 +293,24 @@ public void 
postModifyTable(ObserverContext<MasterCoprocessorEnvironment> ctx,
   public void 
postDeleteNamespace(ObserverContext<MasterCoprocessorEnvironment> ctx,
       String namespace) throws IOException {
     if (checkInitialized("deleteNamespace " + namespace)) {
-      // 1. Record namespace user acl is not synced to HDFS
-      
SnapshotScannerHDFSAclStorage.deleteNamespaceHdfsAcl(ctx.getEnvironment().getConnection(),
-        namespace);
-      // 2. Delete tmp namespace directory
-      /**
-       * Delete namespace tmp directory because it's created by this 
coprocessor when namespace is
-       * created to make namespace default acl can be inherited by tables. The 
namespace data
-       * directory is deleted by DeleteNamespaceProcedure, the namespace 
archive directory is
-       * deleted by HFileCleaner.
-       */
-      hdfsAclHelper.deleteEmptyDir(pathHelper.getTmpNsDir(namespace));
+      try (Table aclTable =
+          
ctx.getEnvironment().getConnection().getTable(PermissionStorage.ACL_TABLE_NAME))
 {
+        // 1. Delete namespace archive dir default ACLs
+        Set<String> users = 
SnapshotScannerHDFSAclStorage.getEntryUsers(aclTable,
+          PermissionStorage.toNamespaceEntry(Bytes.toBytes(namespace)));
+        hdfsAclHelper.removeNamespaceDefaultAcl(namespace, users);
 
 Review comment:
   Is there any test case to address the  default acl removing ?   Better to 
have one, seems easy to miss this..

----------------------------------------------------------------
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]


With regards,
Apache Git Services

Reply via email to