Skip to content

Conversation

@jainankitk
Copy link
Contributor

Description

When using shared Arena pooling, Lucene groups index files together into a single shared Arena to reduce the number of times it has to perform the costly operation of closing an Arena. However, in specific cases, this pooling can become a problem. Setting sharedArenaMaxPermits to a lower value like 1 can solve issues related to "leaked" maps or performance degradation caused by shared Arena pooling.

A value of 1 for sharedArenaMaxPermits effectively disables the pooling of shared Arenas. It forces each MMapDirectory instance to use a confined Arena, which is not owned by a specific thread but is managed in a way that avoids the performance issues associated with closing shared Arenas

Related Issues

Mitigates #19482

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

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.

@jainankitk jainankitk requested a review from a team as a code owner October 2, 2025 00:49
@jainankitk jainankitk added backport 3.1 backport 3.2 Backport to 3.2 branch labels Oct 2, 2025
@jainankitk jainankitk removed v3.3.0 backport 3.1 backport 3.2 Backport to 3.2 branch labels Oct 2, 2025
@saratvemulapalli
Copy link
Member

@jainankitk lets add change log, its worth calling out the fix.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 2, 2025

❌ Gradle check result for 4c665f2: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Signed-off-by: Ankit Jain <[email protected]>
@jainankitk jainankitk added the backport 3.3 Backport to 3.3 branch label Oct 2, 2025
@jainankitk jainankitk changed the title Keeping number of sharedArenaMaxPermits to 1 Setting number of sharedArenaMaxPermits to 1 Oct 2, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Oct 2, 2025

✅ Gradle check result for bbd3a2b: SUCCESS

@codecov
Copy link

codecov bot commented Oct 2, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.99%. Comparing base (4269bdd) to head (bbd3a2b).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #19503      +/-   ##
============================================
+ Coverage     72.97%   72.99%   +0.02%     
- Complexity    70417    70422       +5     
============================================
  Files          5711     5711              
  Lines        322587   322587              
  Branches      46716    46716              
============================================
+ Hits         235402   235481      +79     
+ Misses        68180    68114      -66     
+ Partials      19005    18992      -13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jainankitk jainankitk merged commit 983c4d7 into opensearch-project:main Oct 2, 2025
38 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Oct 2, 2025
Signed-off-by: Ankit Jain <[email protected]>
(cherry picked from commit 983c4d7)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
owaiskazi19 pushed a commit that referenced this pull request Oct 2, 2025
(cherry picked from commit 983c4d7)

Signed-off-by: Ankit Jain <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@jainankitk jainankitk deleted the mmap-fix branch October 3, 2025 21:20
peteralfonsi pushed a commit to peteralfonsi/OpenSearch that referenced this pull request Oct 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport 3.3 Backport to 3.3 branch lucene

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants