Skip to content

SQL: better management of allowPartialSearchResults defaults for CPS#143995

Merged
luigidellaquila merged 6 commits intoelastic:mainfrom
luigidellaquila:sql-cps-error-handling
Mar 12, 2026
Merged

SQL: better management of allowPartialSearchResults defaults for CPS#143995
luigidellaquila merged 6 commits intoelastic:mainfrom
luigidellaquila:sql-cps-error-handling

Conversation

@luigidellaquila
Copy link
Copy Markdown
Contributor

@luigidellaquila luigidellaquila commented Mar 11, 2026

Fix the way SQL manages allowPartialSearchResults defaults in CPS, unifying the logic with what EQL and ES|QL do.

@luigidellaquila luigidellaquila marked this pull request as ready for review March 11, 2026 12:48
@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Mar 11, 2026
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

boolean crossProjectEnabled = new CrossProjectModeDecider(clusterService.getSettings()).crossProjectEnabled();
boolean allowPartialSearchResults = request.allowPartialSearchResults() != null
? request.allowPartialSearchResults()
: crossProjectEnabled;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the main change is here: if allowPartialSearchResults is null, we fallback to CPS default.

boolean keepOnCompletion,
TimeValue keepAlive,
boolean allowPartialSearchResults
Boolean allowPartialSearchResults
Copy link
Copy Markdown
Contributor

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:

Unless I miss something it is actually always supplying it with non-null allowPartialSearchResults

Copy link
Copy Markdown
Contributor Author

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)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

@richard-dennehy richard-dennehy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've confirmed this fixes the failing SQL test I wrote

@luigidellaquila luigidellaquila enabled auto-merge (squash) March 11, 2026 17:23
@luigidellaquila luigidellaquila merged commit cafdc49 into elastic:main Mar 12, 2026
36 checks passed
michalborek pushed a commit to michalborek/elasticsearch that referenced this pull request Mar 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/SQL SQL querying >non-issue Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants