Only update PrivilegesEvaluator configuration when the base config objects have actually changed.#6037
Conversation
…jects have actually changed. Signed-off-by: Nils Bandener <nils.bandener@eliatra.com>
src/main/java/org/opensearch/security/privileges/PrivilegesConfiguration.java
Show resolved
Hide resolved
|
@nibix FYI test failures on the PR. Are you pushing a fix for these? |
|
This are easy to fix ... i am debugging at the moment these: There I am not yet clear on the cause, taking back to draft |
Signed-off-by: Nils Bandener <nils.bandener@eliatra.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #6037 +/- ##
==========================================
- Coverage 74.04% 74.04% -0.01%
==========================================
Files 441 441
Lines 27355 27413 +58
Branches 4083 4110 +27
==========================================
+ Hits 20256 20298 +42
- Misses 5173 5177 +4
- Partials 1926 1938 +12
🚀 New features to boost your workflow:
|
Signed-off-by: Nils Bandener <nils.bandener@eliatra.com>
|
Fixed now. Regarding the codecov issues: These are because of the added equals() and hashCode() methods. TBH, I do not think it makes sense to add test coverage for every single dimension these methods could be used. Thus, I would vote for keeping it the way it is. |
Signed-off-by: Craig Perkins <cwperx@amazon.com>
| generalConfiguration, | ||
| pluginIdToRolePrivileges | ||
| ) | ||
| boolean privilegesChanged = oldRawConfiguration == null |
There was a problem hiding this comment.
Should we switch the ordering of the last 2 checkis here? I imagine oldRawConfiguration.equals(rawConfiguration) is the most expensive to compute.
There was a problem hiding this comment.
I am not sure if it relevant to consider the computation time here. comparing will certainly not take longer than constructing the data structure. and looking into SecurityDynamicConfiguration, we make very liberal use of cloning. So, I would guess that is max a few ms.
src/main/java/org/opensearch/security/privileges/PrivilegesConfiguration.java
Outdated
Show resolved
Hide resolved
…ective-role-updates
Description
This changes PrivilegesConfiguration config change listening logic to only update the PrivilegesEvaluator and DLS/FLS configuration if the underlying configuration objects actually have been changed since the last time.
This can provide a small performance benefit, as for clusters with many roles and indices, the config updates can be costly (a few seconds for very large environments).
Issues Resolved
Fixes #5999
Testing
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.