-
Notifications
You must be signed in to change notification settings - Fork 2.8k
NIFI-14245 Enable caching in DatabaseUserGroupProvider and DatabaseAccessPolicyProvider to improve performance #9707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…cessPolicyProvider to improve performance
I’d really appreciate it if you could review this. |
… calling "onConfigured"
I noticed the changes to the unit tests were incorrect, so I’ve fixed them again. This should allow us to test the same behavior as before the patch, meaning we can confirm that enabling the cache doesn’t actually change anything. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for proposing this improvement @yoshiata. I have not reviewed all of the details, but I'm concerned about the potential complexity introduced through method synchronization and calls to refresh the entire cache of information. The Jira issue description mentions improving the speed of listing users, but this by itself does not seem like sufficient reason to introduce the complexity of caching. If there are additional benefits, are there are some performance comparisons, that may help determine the relative value of introducing the complexity.
@exceptionfactory Thanks for replying! And sorry I didn’t give enough info about the performance. I implemented caching modeled after FileUserGroupProvider class and FileAccessPolicyProvider class as follows:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the reply and performance comparison details on the Jira issue @yoshiata! Although 1000 users is probably on the higher end, that is quite a performance hit.
The reference to the File-based implementations is helpful. I was considering recommending a different approach based on Caffeine Cache, but noting a similar existing approach is useful.
In that light, the strategy seems reasonable in general. I may be able to take a closer look at these changes if others aren't able to review them before me, but I have removed my current request for changes flag.
Thanks for removing the request for changes @exceptionfactory! I’ll wait to see if anyone else has feedback. |
Summary
NIFI-14245
Tracking
Please complete the following tracking steps prior to pull request creation.
Issue Tracking
Pull Request Tracking
NIFI-00000
NIFI-00000
Pull Request Formatting
main
branchVerification
Please indicate the verification steps performed prior to pull request creation.
Build
mvn clean install -P contrib-check
Licensing
LICENSE
andNOTICE
filesDocumentation