Skip to content

HBASE-30561 SnapshotScannerHDFSAclController should match the exact u… - #8928

Open
Apache9 wants to merge 1 commit into
apache:masterfrom
Apache9:HBASE-30561
Open

Apache9 wants to merge 1 commit into
apache:masterfrom
Apache9:HBASE-30561

Conversation

@Apache9

@Apache9 Apache9 commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

…ser permission in postGrant/PostRevoke

@Apache9 Apache9 self-assigned this Nov 24, 2026
@Apache9
Apache9 requested a review from liuxiaocs7 November 26, 2026 07:33

@liuxiaocs7 liuxiaocs7 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Apache9!

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Global grants are mislabeled as table permissions, and incorrect HDFS group ACL names can break group-based snapshot access after direct-permission changes, with regression coverage also missing.

3 open issues
What changed in this PR

Updates HBase’s snapshot-scanning ACL synchronization to use the permission stored for the exact user or group, rather than permissions inherited through group membership.

Changes:

  • Adds exact-principal permission lookups for global, namespace, and table scopes.
  • Uses these lookups when synchronizing HDFS ACLs after grants and revokes.
  • Separates permission-storage tests into a dedicated suite and adds lookup coverage.
File Description
hbase-server/​src/​test/​java/​org/​apache/​hadoop/​hbase/​security/​access/​TestTablePermissions.java Retains split-persistence, permission-equality, and cache tests after moving storage tests.
hbase-server/​src/​test/​java/​org/​apache/​hadoop/​hbase/​security/​access/​TestPermissionStorage.java Adds dedicated storage tests covering exact lookups, revocation, groups, and serialization.
hbase-server/​src/​main/​java/​org/​apache/​hadoop/​hbase/​security/​access/​SnapshotScannerHDFSAclController.java Replaces group-inclusive filtering in grant and revoke hooks.
hbase-server/​src/​main/​java/​org/​apache/​hadoop/​hbase/​security/​access/​PermissionStorage.java Adds direct getters for a principal’s stored permission at each scope.

Review effort: Max (adaptive)

Comment on lines +636 to +637
return getUserPermission(conn, toTableEntryName(tableName), user,
() -> Permission.newBuilder(tableName));
switch (userPermission.getAccessScope()) {
case GLOBAL:
UserPermission perm = getUserGlobalPermission(conn, userName);
UserPermission perm = PermissionStorage.getUserGlobalPermission(conn, userName);
Comment on lines +433 to +434
UserPermission userTablePerm =
PermissionStorage.getUserTablePermission(conn, tableName, userName);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants