-
Notifications
You must be signed in to change notification settings - Fork 25.6k
ESQL: Aggressive release of shard contexts #129454
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
Merged
GalLalouche
merged 30 commits into
elastic:main
from
GalLalouche:feature/shard_ref_count
Jun 25, 2025
Merged
Changes from 7 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
347feb1
ESQL: Aggressive release of shard contexts
GalLalouche 06de0d7
Update docs/changelog/129454.yaml
GalLalouche 25fd514
Fix compilation errors
GalLalouche 0210097
Fix bug caused by mishandling of errors during driver iteration
GalLalouche efc0dfd
Merge branch 'feature/shard_ref_count' of github.com:GalLalouche/elas…
GalLalouche f51a7c4
Change order of removal from first to last
GalLalouche d6ebed2
Remove printlns
GalLalouche 8fb564a
Add ref counter to OrdinalsGroupingOperator
GalLalouche 2843e20
Fix failing test (ManyShardsIT)
GalLalouche cfbf4b2
CR fixes
GalLalouche 1ad8eb4
More test fixes
GalLalouche b0a35b1
Fix random DocVector generation (shard cannot be negative)
GalLalouche 5b9b897
Merge branch 'main' into feature/shard_ref_count
GalLalouche 73ddfe7
More edge cases for shard IDs in tests
GalLalouche e22cc53
Merge branch 'main' into feature/shard_ref_count
GalLalouche 2c25218
Merge branch 'main' into feature/shard_ref_count
GalLalouche e621964
CR comments
GalLalouche 5246f3a
CR fixes
GalLalouche 2f219c8
Merge branch 'main' into feature/shard_ref_count
GalLalouche 4761a2e
Merge branch 'main' into feature/shard_ref_count
GalLalouche ce8462b
Merge branch 'main' into feature/shard_ref_count
GalLalouche aab0407
Merge branch 'main' into feature/shard_ref_count
GalLalouche 6270833
Move shardRefCounter logic to the super class
GalLalouche 97af248
Merge branch 'main' into feature/shard_ref_count
GalLalouche de0d4bd
Fix double ref counting from previous PR
GalLalouche bb9a42b
Merge branch 'main' into feature/shard_ref_count
GalLalouche 69acdfd
Merge branch 'main' into feature/shard_ref_count
GalLalouche c71ae9d
Merge branch 'main' into feature/shard_ref_count
GalLalouche c8af2c6
Merge branch 'feature/shard_ref_count' of github.com:GalLalouche/elas…
GalLalouche 3d28f52
Merge branch 'main' into feature/shard_ref_count
GalLalouche File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| pr: 129454 | ||
| summary: Aggressive release of shard contexts | ||
| area: ES|QL | ||
| type: enhancement | ||
| issues: [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -152,7 +152,12 @@ protected SearchContext createContext( | |
| @Override | ||
| public SearchContext createSearchContext(ShardSearchRequest request, TimeValue timeout) throws IOException { | ||
| SearchContext searchContext = super.createSearchContext(request, timeout); | ||
| onPutContext.accept(searchContext.readerContext()); | ||
| try { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was done after confirming with @dnhatn that |
||
| onCreateSearchContext.accept(searchContext); | ||
| } catch (Exception e) { | ||
| searchContext.close(); | ||
| throw e; | ||
| } | ||
| searchContext.addReleasable(() -> onRemoveContext.accept(searchContext.readerContext())); | ||
| return searchContext; | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.