RANGER-3899: performance improvement for policies with many users/groups/roles (ranger-2.9)#970
Open
ramackri wants to merge 4 commits into
Open
RANGER-3899: performance improvement for policies with many users/groups/roles (ranger-2.9)#970ramackri wants to merge 4 commits into
ramackri wants to merge 4 commits into
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
| <query>SELECT count(obj.id) FROM XXPolicy obj where obj.zoneId IS NOT NULL AND obj.zoneId != :zoneId</query> | ||
| </named-query> | ||
|
|
||
| <named-query name="XXGdsDataset.findByGuid"> |
Contributor
There was a problem hiding this comment.
XXGdsDataset is part of GDS feature which is in master branch but not in ranger-2.9 branch. Please review and remove updates that aren't relevant to RANGER-3899.
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