RANGER-3899: performance improvement for policies with many users/groups/roles (ranger-2.9)#970
Merged
Merged
Conversation
Restore policy ref updater unit tests adapted for batch DAO APIs and 5-arg createNewPolMappingForRefTable. Use JUnit 4 + MockitoJUnitRunner so tests run under security-admin Surefire 2.18.1 without pom changes. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
Author
mneethiraj
reviewed
May 25, 2026
Align jpa_named_queries.xml with d1589d629: keep only the 13 named queries required for policy ref updater performance work. Remove XXGds* (GDS), XXPolicy.findByServiceType, and other queries not present on ranger-2.9. Restore XXRMSResourceMapping.deleteByServiceResourceIds. Co-authored-by: Cursor <cursoragent@cursor.com>
mneethiraj
approved these changes
May 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What changes were proposed in this pull request?
Backport of apache/ranger@d1589d629 (RANGER-3899) to
ranger-2.9:PolicyRefUpdateroptimizations andServiceDBStoreupdate-path changesdev-support/checks/coverage.shFollow-up on this branch: fix
TestServiceDBStore.tess28updatePolicyfor the new ref-table API; omitTestPolicyRefUpdater(JUnit 5) becauseranger-2.9security-adminstill uses Surefire 2.18.1 — no Surefire/JUnit5 pom change for this release backport.How was this patch tested?
mvn -pl security-admin test -Dtest=TestServiceDBStore(47 tests, pass)mvn -pl security-admin pmd:check(pass)Summary
Manual smoke verification of policy test123 (policy ID 48) on the dev_hive service after local Docker deployment. Focus: users/groups/roles on policy edit and consistency between REST API and
x_policy_ref_*tables (policy ref updater path).Test environment
dev_hive(service ID 5)ranger-postgres)Verification performed
Infrastructure
Policy 48 — REST API (
GET /service/public/v2/api/policy/48)test123dev_hiveramk,admin,keyadmin,knox,hbase,hdfs,rangertagsyncTestGroup1…TestGroup5TestRole1,TestRole3,TestRole4,TestRole5Database —
x_policy_ref_*(policy_id = 48)x_policy_ref_userx_policy_ref_groupx_policy_ref_roleConclusion: Persisted policy state is consistent between REST API and ref tables on read — good signal for the ref-updater persistence path.
Manually tested In the local Docker setup
How to reproduce