virajjasani commented on PR #5437:
URL: https://github.com/apache/hbase/pull/5437#issuecomment-1736183051

   > And on debugging, it is very easy to reproduce in the individual test, 
just create a snapshot before doing anything, the test will fail.
   
   I did this, however i see that for both behaviors, the test fails i.e. with 
or without HBASE-28042 patch, the test fails anyways.
   
   Sample patch to reproduce:
   
   ```
   diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotDescriptionUtils.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotDescriptionUtils.java
   index 689cd89259..730f1dc9e2 100644
   --- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotDescriptionUtils.java
   +++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotDescriptionUtils.java
   @@ -422,7 +422,7 @@ public final class SnapshotDescriptionUtils {
    
        if (
          (shouldSkipRenameSnapshotDirectories(workingURI, rootURI)
   -        || !fs.rename(workingDir, snapshotDir))
   +        || !FileUtil.copy(workingDirFs, workingDir, fs, snapshotDir, true, 
true, conf))
            && !FileUtil.copy(workingDirFs, workingDir, fs, snapshotDir, true, 
true, conf)
        ) {
          throw new SnapshotCreationException("Failed to copy working 
directory(" + workingDir
   diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestSnapshotScannerHDFSAclController3.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestSnapshotScannerHDFSAclController3.java
   index 42d8a43588..f2e7e2af98 100644
   --- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestSnapshotScannerHDFSAclController3.java
   +++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestSnapshotScannerHDFSAclController3.java
   @@ -156,11 +156,11 @@ public class TestSnapshotScannerHDFSAclController3 {
        String globalUserName2 = tableUserName + "-global-2";
        User globalUser2 = User.createUserForTesting(conf, globalUserName2, new 
String[] {});
    
   -    SecureTestUtil.grantGlobal(TEST_UTIL, globalUserName, READ);
        TestHDFSAclHelper.createNamespace(TEST_UTIL, namespace);
        SecureTestUtil.grantOnNamespace(TEST_UTIL, nsUserName, namespace, READ);
        TableDescriptor td = 
TestHDFSAclHelper.createUserScanSnapshotDisabledTable(TEST_UTIL, table);
        snapshotAndWait(snapshot, table);
   +    SecureTestUtil.grantGlobal(TEST_UTIL, globalUserName, READ);
        SecureTestUtil.grantGlobal(TEST_UTIL, globalUserName2, READ);
        TestHDFSAclHelper.grantOnTable(TEST_UTIL, tableUserName, table, READ);
        SecureTestUtil.grantOnTable(TEST_UTIL, tableUserName2, table, 
TestHDFSAclHelper.COLUMN1, null,
   
   ```
   
   This sample patch reverts HBASE-28042 and also creates snapshot before 
granting READ permission to global user and the test fails. Same test failure 
behavior is observed even with HBASE-28042 patch i.e.
   
   ```
   diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestSnapshotScannerHDFSAclController3.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestSnapshotScannerHDFSAclController3.java
   index 42d8a43588..f2e7e2af98 100644
   --- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestSnapshotScannerHDFSAclController3.java
   +++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestSnapshotScannerHDFSAclController3.java
   @@ -156,11 +156,11 @@ public class TestSnapshotScannerHDFSAclController3 {
        String globalUserName2 = tableUserName + "-global-2";
        User globalUser2 = User.createUserForTesting(conf, globalUserName2, new 
String[] {});
    
   -    SecureTestUtil.grantGlobal(TEST_UTIL, globalUserName, READ);
        TestHDFSAclHelper.createNamespace(TEST_UTIL, namespace);
        SecureTestUtil.grantOnNamespace(TEST_UTIL, nsUserName, namespace, READ);
        TableDescriptor td = 
TestHDFSAclHelper.createUserScanSnapshotDisabledTable(TEST_UTIL, table);
        snapshotAndWait(snapshot, table);
   +    SecureTestUtil.grantGlobal(TEST_UTIL, globalUserName, READ);
        SecureTestUtil.grantGlobal(TEST_UTIL, globalUserName2, READ);
        TestHDFSAclHelper.grantOnTable(TEST_UTIL, tableUserName, table, READ);
        SecureTestUtil.grantOnTable(TEST_UTIL, tableUserName2, table, 
TestHDFSAclHelper.COLUMN1, null,
   ```


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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to