Skip to content

Conversation

@luigidellaquila
Copy link
Contributor

In CPS we don't have skip_unavailable, we'll use allow_partial_resultsinstead

EsqlExecutionInfo executionInfo,
ActionListener<LookupResponse> lookupListener
) {
if (ExceptionsHelper.isRemoteUnavailableException(e) && executionInfo.shouldSkipOnFailure(cluster)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think org.elasticsearch.xpack.esql.action.EsqlExecutionInfo#skipOnFailurePredicate is initialized with essentially the same:

return new EsqlExecutionInfo(clusterAlias -> remoteClusterService.isSkipUnavailable(clusterAlias).orElse(true), includeCcsMetadata);

But that is definitely confusing that we use different things in different palces

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, now that predicate is the place where we centralize this behavior.

@luigidellaquila luigidellaquila marked this pull request as ready for review September 26, 2025 15:18
@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Sep 26, 2025
@elasticsearchmachine
Copy link
Collaborator

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

listener
);
protected void getRemoteConnection(String cluster, EsqlExecutionInfo executionInfo, ActionListener<Transport.Connection> listener) {
remoteClusterService.maybeEnsureConnectedAndGetConnection(cluster, executionInfo.shouldSkipOnFailure(cluster) == false, listener);
Copy link
Contributor

Choose a reason for hiding this comment

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

Just to ensure - the desired behavior on CPS is that we always want to try to reconnect immediately if the connection is bad, when allow_partial = true, and don't try to reconnect when allow_partial = false?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's a bit of a stretch, as allow_partial is not really about connection retries, but on the other hand the previous behavior relied on skip_unavailable, that is a bit closer to the concept of connection but not really about reconnection either.
In conclusion, IMHO this is fine in terms of consistency (also compared to stateful).

remoteClusterService.isSkipUnavailable(cluster).orElse(true) == false,
listener
);
protected void getRemoteConnection(String cluster, EsqlExecutionInfo executionInfo, ActionListener<Transport.Connection> listener) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Not saying this is wrong, but here you don't actually need EsqlExecutionInfo, only one flag that describes executionInfo.shouldSkipOnFailure(cluster) == false which is ensureConnected value. So maybe this should be boolean ensureConnected too?

String cluster,
EsqlExecutionInfo executionInfo,
ActionListener<LookupResponse> lookupListener
) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Here again (as below) we don't really need neither cluster nor EsqlExecutionInfo but only boolean executionInfo.shouldSkipOnFailure(cluster). Maybe we could simplify it by calculating this boolean above and pass it to the methods that need it? Just a suggestion.

@luigidellaquila luigidellaquila merged commit 400cf61 into elastic:main Sep 30, 2025
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/ES|QL AKA ESQL >non-issue Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants