Skip to content

RANGER-5763: Fix NPE in HBase plugin snapshot hooks when table descriptor is null - #1184

Open
shmilygkd wants to merge 1 commit into
apache:masterfrom
shmilygkd:hbase-snapshot-null-table-descriptor
Open

RANGER-5763: Fix NPE in HBase plugin snapshot hooks when table descriptor is null#1184
shmilygkd wants to merge 1 commit into
apache:masterfrom
shmilygkd:hbase-snapshot-null-table-descriptor

Conversation

@shmilygkd

Copy link
Copy Markdown

What changes were proposed in this pull request?

HBase 2.6.3/2.6.4 call the preSnapshot coprocessor hook with a null TableDescriptor when the table does not exist: HBASE-29361 moved the snapshot hooks ahead of the table-existence check and passes the descriptor from getTableDescriptors().get() without a null check. RangerAuthorizationCoprocessor dereferences the descriptor in preSnapshot/preCloneSnapshot/preRestoreSnapshot, so taking a snapshot of a non-existent table throws an NPE inside the coprocessor, and with hbase.coprocessor.abortonerror defaulting to true the HMaster aborts.

HBase corrected the ordering in HBASE-29955 (2.6.5); this change makes the plugin tolerate a null descriptor: the permission check is skipped when the descriptor is null, and the operation is rejected by HBase itself.

How was this patch tested?

Unit tests added to RangerAuthorizationCoprocessorTest: the snapshot hooks skip the permission check when the table descriptor is null and run it when the descriptor is present. The failure mode was observed on a cluster running HBase 2.6.3 with the ranger hbase plugin.

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.

1 participant