-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Populate cross cluster info after index resolution #137317
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
base: main
Are you sure you want to change the base?
Conversation
|
Pinging @elastic/es-analytical-engine (Team:Analytics) |
| preAnalysis.useAggregateMetricDoubleWhenNotSupported(), | ||
| preAnalysis.useDenseVectorWhenNotSupported(), | ||
| listener.delegateFailureAndWrap((l, indexResolution) -> { | ||
| EsqlCCSUtils.initCrossClusterInfo(indicesExpressionGrouper, verifier.licenseState(), indexPattern, executionInfo); |
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.
Here the state will be populated from field caps resolvedTo data structure if that is available.
We will keep existing approach for responses from older clusters that do not have this information available.
| final String indexExpr = Strings.arrayToCommaDelimitedString(entry.getValue().indices()); | ||
| groupedIndices.forEach((clusterAlias, indexGroup) -> { | ||
| executionInfo.swapCluster(clusterAlias, (k, v) -> { | ||
| assert v == null : "No cluster for " + clusterAlias + " should have been added to ExecutionInfo yet"; |
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.
This is not longer the case. We could have 2 distinct views targeting the same remote. In such case, their expressions are going to be concatenated.
Today we populate cross cluster state in esql execution info before performing main field caps.
This has several issues:
logs-*,-*2024+metrics-*,-*2025would incorrectly exclude logs-2025 and metrics-2024. This in turn can exclude the entire remote if those are the only indices on it).org.elasticsearch.indices.IndicesExpressionGrouper#groupIndicesthat could not correctly expand flat/cps expressions.This change moves cross cluster info population to after main field caps result is received.