[Performance] Call AdminDns.isAdmin once per request#5752
[Performance] Call AdminDns.isAdmin once per request#5752cwperks merged 4 commits intoopensearch-project:mainfrom
Conversation
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Craig Perkins <cwperx@amazon.com>
DarshitChanpura
left a comment
There was a problem hiding this comment.
Change looks good to me. Can we add a test to confirm the before/after of this change?
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5752 +/- ##
==========================================
- Coverage 73.12% 73.05% -0.08%
==========================================
Files 435 435
Lines 26665 26671 +6
Branches 3999 3999
==========================================
- Hits 19499 19484 -15
- Misses 5249 5269 +20
- Partials 1917 1918 +1
🚀 New features to boost your workflow:
|
|
Just out of curiousity: Do we know what's the actual bottleneck in security/src/main/java/org/opensearch/security/configuration/AdminDNs.java Lines 134 to 143 in da520a0 I am wondering if this could be handled diferently, possibly during authc already. |
Signed-off-by: Craig Perkins <cwperx@amazon.com>
It is hitting the catch block for every field. The autocomplete feature of Dev Tools in OSD has been known to cause cluster instability, so this fix would only optimize this to some extent. Dev Tools is still going to degrade in performance for clusters with a very large number of indices + mappings bc Dev Tools tries to load mappings for all indices of the cluster on page load.
yes I think that makes sense. We should only ever call |
Description
This PR fixes on issue on the
GET _mappingsAPI where the security plugin may repeatedly callAdminDns.isAdminfor every single field across all index mappings. The changes in this PR make it so that its called once per request.Bug fix
Issues Resolved
To be created
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.