Skip to content

RANGER-5764:Enhancing RangerUserStore to include or exclude user group mappings - #1185

Open
abhiishek26 wants to merge 1 commit into
apache:masterfrom
abhiishek26:UserStore-enhancements
Open

RANGER-5764:Enhancing RangerUserStore to include or exclude user group mappings #1185
abhiishek26 wants to merge 1 commit into
apache:masterfrom
abhiishek26:UserStore-enhancements

Conversation

@abhiishek26

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

1>Currently, when RangerUserStoreCache refreshes the user store from the database, it always attempts to load user-to-group mappings. In large deployments with a high number of users and groups, loading these mappings on every refresh can significantly increase overhead .

2>I have made it to flag based approach , if flag is set to true then the mappings to the plugins will be provided by the UserStore download apis else not .

3>The major cause of performance bottleneck was final Map<String, Set> userGroups = xUserMgr.getUserGroups();
which has been changed to
final Map<String, Set> userGroups = downloadUserGroupsEnabled ? xUserMgr.getUserGroups() : new HashMap<>();
so based on the requirements we can download or skip user-group mappings in UserStore for Plugins

How was this patch tested?

1>For performance testing this patch was tested for 1 million users and .5 million groups where every 2 user was mapped to one group creating .5 million mappings
2>mvn clean test and mvn clean install were performed locally

@vikaskr22

Copy link
Copy Markdown
Contributor

@abhiishek26 , please check if you have used the correct JIRA ID in the commit.

</property>
<!-- User-store download Properties starts-->
<property>
<name>ranger.admin.userstore.download.usergroups.enabled</name>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I suggest renaming the property to ranger.admin.userstore.include.usergroups.mappings.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks @mneethiraj , I have updated it

@spolavarpau1

Copy link
Copy Markdown
Contributor

@abhiishek26 , can you also update the title of the commit with correct jira number? (https://issues.apache.org/jira/browse/RANGER-5764)

@abhiishek26 abhiishek26 changed the title RANGER-5734:Enhancing RangerUserStore to include or exclude user group mappings RANGER-5764:Enhancing RangerUserStore to include or exclude user group mappings Aug 26, 2026
@abhiishek26
abhiishek26 force-pushed the UserStore-enhancements branch from 5c76aed to 2604bcb Compare August 26, 2026 12:12
@abhiishek26

Copy link
Copy Markdown
Contributor Author

@abhiishek26 , please check if you have used the correct JIRA ID in the commit.

Thanks Vikas , Sorry it was a mismatch

@abhiishek26

Copy link
Copy Markdown
Contributor Author

@abhiishek26 , can you also update the title of the commit with correct jira number? (https://issues.apache.org/jira/browse/RANGER-5764)

Thanks @spolavarpau1 , I have updated it

@abhiishek26
abhiishek26 force-pushed the UserStore-enhancements branch from 2604bcb to 5bbd0a8 Compare August 26, 2026 12:37
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.

4 participants