Skip to content

Conversation

@nibix
Copy link
Collaborator

@nibix nibix commented May 27, 2025

Description

This is a minimal quick fix to solve the performance issues described in #5342 and #5129 also for OpenSearch 2.19.

It won't be as fast as the implementation in #5350, as it still requires loops. Still, micro benchmarks on ConfigModelV7.mapTenants() show a huge improvement (10 threads, 10000 iterations):

  • 2.19.1 release version: 2.14 ms per call
  • This change: 0.065 ms per call

This can be achieved by avoiding calls to SecurityDynamicConfiguration.getCEntries() which will always copy the config HashMap in a synchronized block - thus very strongly limiting the concurrency on the particular node.

  • Category: Performance improvement
  • Why these changes are required? Performance issues on clusters with many tenants
  • What is the old behavior before changes and new behavior after changes? None

Issues Resolved

Fixes #5342
Fixes #5129

Related fix for 3.0: #5350

Testing

  • Existing integration tests

Check List

  • Commits are signed per the DCO using --signoff

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.

@codecov
Copy link

codecov bot commented May 27, 2025

Codecov Report

Attention: Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 68.13%. Comparing base (79ab0b8) to head (34e7e17).
Report is 1 commits behind head on 2.19.

Files with missing lines Patch % Lines
...pensearch/security/securityconf/ConfigModelV7.java 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             2.19    #5368      +/-   ##
==========================================
- Coverage   68.17%   68.13%   -0.04%     
==========================================
  Files         347      347              
  Lines       24624    24625       +1     
  Branches     4084     4084              
==========================================
- Hits        16788    16779       -9     
- Misses       5917     5930      +13     
+ Partials     1919     1916       -3     
Files with missing lines Coverage Δ
...pensearch/security/securityconf/ConfigModelV7.java 67.98% <66.66%> (+0.06%) ⬆️

... and 6 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cwperks cwperks merged commit c158619 into opensearch-project:2.19 May 27, 2025
80 of 81 checks passed
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.

3 participants