Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HBASE-27469 IllegalArgumentException is thrown by SnapshotScannerHDFS… #4865

Merged
merged 1 commit into from
Nov 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ boolean checkInitialized(String operation) {
if (aclTableInitialized) {
return true;
} else {
LOG.warn("Skip set HDFS acls because acl table is not initialized when " + operation);
LOG.warn("Skip set HDFS acls because acl table is not initialized when {}", operation);
}
}
return false;
Expand Down Expand Up @@ -610,7 +610,7 @@ private Set<String> filterUsersToRemoveNsAccessAcl(Table aclTable, TableName tab
PermissionStorage.isGlobalEntry(entry)
|| (PermissionStorage.isNamespaceEntry(entry)
&& Bytes.equals(PermissionStorage.fromNamespaceEntry(entry), namespace))
|| (!Bytes.equals(tableName.getName(), entry)
|| (PermissionStorage.isTableEntry(entry) && !Bytes.equals(tableName.getName(), entry)
&& Bytes.equals(TableName.valueOf(entry).getNamespace(), namespace))
) {
remove = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ public void testDeleteTable() throws Exception {
// delete table
admin.disableTable(table);
admin.deleteTable(table);
// grantUser2 and grantUser3 should have data/ns acl
// grantUser2 should have data/ns acl
TestHDFSAclHelper.canUserScanSnapshot(TEST_UTIL, grantUser1, snapshot1, -1);
TestHDFSAclHelper.canUserScanSnapshot(TEST_UTIL, grantUser2, snapshot1, 6);
assertTrue(hasUserNamespaceHdfsAcl(aclTable, grantUserName2, namespace));
Expand All @@ -673,6 +673,26 @@ public void testDeleteTable() throws Exception {
deleteTable(table);
}

@Test
public void testDeleteTable2() throws Exception {
String namespace1 = name.getMethodName() + "1";
String namespace2 = name.getMethodName() + "2";
String grantUser = name.getMethodName();
TableName table = TableName.valueOf(namespace1, name.getMethodName());

TestHDFSAclHelper.createTableAndPut(TEST_UTIL, table);
// grant user table permission
TestHDFSAclHelper.grantOnTable(TEST_UTIL, grantUser, table, READ);
// grant user other namespace permission
SecureTestUtil.grantOnNamespace(TEST_UTIL, grantUser, namespace2, READ);
// delete table
admin.disableTable(table);
admin.deleteTable(table);
// grantUser should have namespace2's acl
assertFalse(hasUserTableHdfsAcl(aclTable, grantUser, table));
assertTrue(hasUserNamespaceHdfsAcl(aclTable, grantUser, namespace2));
}

@Test
public void testDeleteNamespace() throws Exception {
String grantUserName = name.getMethodName();
Expand Down