-
Notifications
You must be signed in to change notification settings - Fork 25.8k
SQL: better management of allowPartialSearchResults defaults for CPS #143995
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
luigidellaquila
merged 6 commits into
elastic:main
from
luigidellaquila:sql-cps-error-handling
Mar 12, 2026
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
32c89f0
SQL: better management of allow_partial_search_results defaults for CPS
luigidellaquila 4fd96f7
Add transport version validation to sql-action
luigidellaquila 7e58576
Merge branch 'main' into sql-cps-error-handling
luigidellaquila f537497
Merge branch 'main' into sql-cps-error-handling
luigidellaquila dc3b15f
Merge remote-tracking branch 'luigidellaquila/sql-cps-error-handling'…
luigidellaquila fa74f64
Merge branch 'main' into sql-cps-error-handling
luigidellaquila 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
1 change: 1 addition & 0 deletions
1
...n/resources/transport/definitions/referable/sql_optional_allow_partial_search_results.csv
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 @@ | ||
| 9313000 |
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 |
|---|---|---|
| @@ -1 +1 @@ | ||
| transform_indices_options,9312000 | ||
| sql_optional_allow_partial_search_results,9313000 |
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
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 |
|---|---|---|
|
|
@@ -155,6 +155,10 @@ public static void operation( | |
| ) { | ||
| // The configuration is always created however when dealing with the next page, only the timeouts are relevant | ||
| // the rest having default values (since the query is already created) | ||
| boolean crossProjectEnabled = new CrossProjectModeDecider(clusterService.getSettings()).crossProjectEnabled(); | ||
| boolean allowPartialSearchResults = request.allowPartialSearchResults() != null | ||
| ? request.allowPartialSearchResults() | ||
| : crossProjectEnabled; | ||
|
Contributor
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. I believe the main change is here: if |
||
| SqlConfiguration cfg = new SqlConfiguration( | ||
| request.zoneId(), | ||
| request.catalog(), | ||
|
|
@@ -172,8 +176,8 @@ public static void operation( | |
| request.indexIncludeFrozen(), | ||
| new TaskId(clusterService.localNode().getId(), task.getId()), | ||
| task, | ||
| request.allowPartialSearchResults(), | ||
| new CrossProjectModeDecider(clusterService.getSettings()).crossProjectEnabled(), | ||
| allowPartialSearchResults, | ||
| crossProjectEnabled, | ||
| request.projectRouting() | ||
| ); | ||
|
|
||
|
|
||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems the request is only initialized here:
elasticsearch/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlQueryRequestBuilder.java
Line 95 in 2b07fec
Unless I miss something it is actually always supplying it with non-null
allowPartialSearchResultsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you're right, that's overprotective. Let me simplify it (we can also avoid the transport version bump)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, sorry, my bad, the implementation is correct.
XContent parser uses the other constructor https://github.com/elastic/elasticsearch/blob/main/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlQueryRequest.java#L50