HBASE-23824 TestSnapshotScannerHDFSAclController is flakey (#1157)

Signed-off-by: stack <stack@apache.org>
This commit is contained in:
meiyi 2020-02-11 01:40:05 +08:00 committed by GitHub
parent cdc98e906c
commit 29a36568b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 10 deletions

View File

@ -222,9 +222,9 @@ public class SnapshotScannerHDFSAclController implements MasterCoprocessor, Mast
} }
@Override @Override
public void postDeleteTable(ObserverContext<MasterCoprocessorEnvironment> ctx, public void postCompletedDeleteTableAction(ObserverContext<MasterCoprocessorEnvironment> ctx,
TableName tableName) throws IOException { TableName tableName) throws IOException {
if (needHandleTableHdfsAcl(tableName, "deleteTable " + tableName)) { if (!tableName.isSystemTable() && checkInitialized("deleteTable " + tableName)) {
/* /*
* Remove table user access HDFS acl from namespace directory if the user has no permissions * Remove table user access HDFS acl from namespace directory if the user has no permissions
* of global, ns of the table or other tables of the ns, eg: Bob has 'ns1:t1' read permission, * of global, ns of the table or other tables of the ns, eg: Bob has 'ns1:t1' read permission,
@ -235,6 +235,7 @@ public class SnapshotScannerHDFSAclController implements MasterCoprocessor, Mast
try (Table aclTable = try (Table aclTable =
ctx.getEnvironment().getConnection().getTable(PermissionStorage.ACL_TABLE_NAME)) { ctx.getEnvironment().getConnection().getTable(PermissionStorage.ACL_TABLE_NAME)) {
Set<String> users = SnapshotScannerHDFSAclStorage.getTableUsers(aclTable, tableName); Set<String> users = SnapshotScannerHDFSAclStorage.getTableUsers(aclTable, tableName);
if (users.size() > 0) {
// 1. Remove table archive directory default ACLs // 1. Remove table archive directory default ACLs
hdfsAclHelper.removeTableDefaultAcl(tableName, users); hdfsAclHelper.removeTableDefaultAcl(tableName, users);
// 2. Delete table owner permission is synced to HDFS in acl table // 2. Delete table owner permission is synced to HDFS in acl table
@ -247,6 +248,7 @@ public class SnapshotScannerHDFSAclController implements MasterCoprocessor, Mast
} }
} }
} }
}
@Override @Override
public void postModifyTable(ObserverContext<MasterCoprocessorEnvironment> ctx, public void postModifyTable(ObserverContext<MasterCoprocessorEnvironment> ctx,