No special handling rules for skip_unavailable=true clusters at plan time other than disconnected exceptions#120236
Conversation
9008195 to
93f6d26
Compare
…time other than disconnected exceptions
002d89c to
d5aea8c
Compare
|
Pinging @elastic/es-analytical-engine (Team:Analytics) |
| { | ||
| String q = "FROM nomatch*,cluster-a:nomatch*"; | ||
| VerificationException e = expectThrows(VerificationException.class, () -> runQuery(q, requestIncludeMeta)); | ||
| assertThat(e.getDetailedMessage(), containsString("Unknown index [cluster-a:nomatch*,nomatch*]")); |
There was a problem hiding this comment.
Interesting note here: why is the order not kept? User specified nomatch*,cluster-a:nomatch*.
There was a problem hiding this comment.
This ordering seems to happen in RemoteClusterAware#groupClusterIndices().
| e = expectThrows(VerificationException.class, () -> runQuery(limit0, requestIncludeMeta)); | ||
| assertThat(e.getDetailedMessage(), containsString("Unknown index [cluster-a:nomatch,nomatch*]")); | ||
| } | ||
| // an error is thrown if there is a concrete index that does not match |
There was a problem hiding this comment.
I think you could simplify a bit the entire series of VerificationExceptions here and extract a method with common functionality. For example:
private void expectVerificationExceptionForQuery(String q, String error, Boolean requestIncludeMeta) {
VerificationException e = expectThrows(VerificationException.class, () -> runQuery(q, requestIncludeMeta));
assertThat(e.getDetailedMessage(), containsString(error));
String limit0 = q + " | LIMIT 0";
e = expectThrows(VerificationException.class, () -> runQuery(limit0, requestIncludeMeta));
assertThat(e.getDetailedMessage(), containsString(error));
}
IntelliJ tells me I could use the method above in 12 places in this test method.
There was a problem hiding this comment.
Good idea. Changed in latest push.
| String remote2Index = (String) testClusterInfo.get("remote2.index"); | ||
|
|
||
| createIndexAliases(numClusters); | ||
| setSkipUnavailable(REMOTE_CLUSTER_1, true); |
There was a problem hiding this comment.
My understanding (from the documentation) is that skip_unavailable is false by default, if not explicitly set.
Likely I am missing something, but shouldn't skip_unvailable value not matter in this test method? Meaning, it can either be un-set, set to false or set to true, the VerificationException should be thrown no matter what, when an inexistent index is specified (concrete or as part of a wildcarded expression when 0 indices are found).
There was a problem hiding this comment.
My understanding (from the documentation) is that skip_unavailable is false by default, if not explicitly set
That used to be the case but was changed to default to true in 8.15: #105792
shouldn't skip_unvailable value not matter in this test method? Meaning, it can either be un-set, set to false or set to true
That is correct, which is why I removed the explicit setting of skip_unavailable here (since it used to matter). Now it gets set to a random setting by this part of the test setup. It is randomized a test case set up for all tests unless a specific test needs to specifically override it and set a specific value which is what this test used to do. Now it just allows the random value.
There was a problem hiding this comment.
Hm... I was slightly mislead by our docs on this, grabbing the first piece of info on the default value I found. We might have a small inconsistency here, even though in other places it is specifically mentioned that the default changed from false to true.

💚 Backport successful
|
…time other than disconnected exceptions (elastic#120236) For ES|QL, we are moving to limit the scope of the skip_unavailable setting for remote clusters. Going forward, skip_unavailable will be considered for two scenarios: 1) inability to connect to a remote cluster ("unavailable") 2) whether to fail on execution time errors or not (inline with the upcoming allow_partial_search_results work for ES|QL). This PR reverses the special plan-time handling for skip_unavailable=true clusters that was added in elastic#116348. Remote clusters, regardless of their skip_unavailable setting, will now use the same logic as the local cluster for index expression analysis at plan time, namely: 1) If any concrete index specified is missing from the cluster, a VerificationException will be thrown 2) If no matching index/alias/datastream was found on any cluster (even if all were specified with a wildcard), a VerificationException will be thrown Thus, we no longer require at least one matching index expression for skip_unavailable=false clusters either, as was done in the previous PR referenced above.
…time other than disconnected exceptions (#120236) (#120628) For ES|QL, we are moving to limit the scope of the skip_unavailable setting for remote clusters. Going forward, skip_unavailable will be considered for two scenarios: 1) inability to connect to a remote cluster ("unavailable") 2) whether to fail on execution time errors or not (inline with the upcoming allow_partial_search_results work for ES|QL). This PR reverses the special plan-time handling for skip_unavailable=true clusters that was added in #116348. Remote clusters, regardless of their skip_unavailable setting, will now use the same logic as the local cluster for index expression analysis at plan time, namely: 1) If any concrete index specified is missing from the cluster, a VerificationException will be thrown 2) If no matching index/alias/datastream was found on any cluster (even if all were specified with a wildcard), a VerificationException will be thrown Thus, we no longer require at least one matching index expression for skip_unavailable=false clusters either, as was done in the previous PR referenced above.
For ES|QL, we are moving to limit the scope of the skip_unavailable setting for remote clusters.
Going forward, skip_unavailable will be considered for two scenarios:
This PR reverses the special plan-time handling for skip_unavailable=true clusters that was added in #116348. Remote clusters, regardless of their
skip_unavailablesetting, will now use the same logic as the local cluster for index expression analysis at plan time, namely:Thus, we no longer require at least one matching index expression for skip_unavailable=false clusters either, as was done in the previous PR referenced above.