ramackri opened a new pull request, #1014:
URL: https://github.com/apache/ranger/pull/1014

   ## What changes were proposed in this pull request?
   
   Optimized `RoleRefUpdater` and related role-ref DAOs so role create/update 
performs fewer database round-trips when a role references many users, groups, 
and sub-roles. The design mirrors 
[RANGER-3899](https://issues.apache.org/jira/browse/RANGER-3899) / PR 
[#962](https://github.com/apache/ranger/pull/962) (`PolicyRefUpdater`).
   When creating or updating a role with a large number of principals, Ranger 
Admin was slow because:
   
   1. **N+1 lookups** — Users, groups, and sub-roles were resolved with 
repeated per-name database calls during ref-table maintenance.
   2. **Full ref-table rebuild on every update** — 
`createNewRoleMappingForRefTable()` always called `cleanupRefTables()`, 
deleting all rows from `x_role_ref_user`, `x_role_ref_group`, and 
`x_role_ref_role`, then re-inserting every principal even when nothing changed.
   3. **Monolithic associator** — A single `RolePrincipalAssociator` took three 
collection parameters and populated one of them inside `doAssociate()`, which 
was harder to read and inconsistent with the refactored policy path.
   
   ## How was this patch tested?
   
   Refer:https://github.com/apache/ranger/pull/980
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to