-
Notifications
You must be signed in to change notification settings - Fork 25.6k
ccs_minimize_roundtrips should default to true for async search for CPS
#135614
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
ccs_minimize_roundtrips should default to true for async search for CPS
#135614
Conversation
…or CPS MRT defaults to `true` for _search and `false` for _async_search. However, we'd want it to default to `true` for both for CPS. Fulfills CPS requirement S2D18.
server/src/main/java/org/elasticsearch/rest/action/search/RestSearchAction.java
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/action/search/TransportSearchAction.java
Outdated
Show resolved
Hide resolved
|
Pinging @elastic/es-search-foundations (Team:Search Foundations) |
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.
First review completed with changes requested.
server/src/main/java/org/elasticsearch/rest/action/search/RestSearchAction.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/rest/action/search/RestSearchAction.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/rest/action/search/RestSearchAction.java
Show resolved
Hide resolved
.../lang-mustache/src/main/java/org/elasticsearch/script/mustache/RestSearchTemplateAction.java
Outdated
Show resolved
Hide resolved
| parser, | ||
| clusterSupportsFeature, | ||
| size -> failOnSizeSpecified(), | ||
| Optional.empty() |
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.
Do we know that none of the subclasses of this class are cross-project enabled? We'll need to track those down and ensure that this Optional.empty() is valid for all. Otherwise, that arg will need to be added to the parseInternalRequest method signature.
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.
Irrespective of whether they're CPS-enabled or not, Optional.empty() could be a valid argument since:
- Their behaviour does not change for this value, and,
- This value can be a placeholder to denote that an endpoint does not need any CPS-specific handling during parsing.
Passing in true or false would've marked their behaviour more explicitly. I'd prefer evaluating their CPS compatibility and updating this value in a separate PR. Wdyt?
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.
I don't think I follow. If any CPS-enabled endpoints are using this AbstractBulkByQueryRestHandler class as a parent, then they must not pass in Optional.empty() because setting ccs_minimize_roundtrips is not allowed in that case. I doubt any bulk endpoints are CCS enabled, but we need to track them down to make sure.
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.
The two endpoints using AbstractBulkByQueryRestHandler are _update_by_query and _delete_by_query. They accept CCS patterns such as foo*,remote*:bar*. However, the remotes included are not affected. For example, /*,*:*/_delete_by_query does not affect the remotes' docs. Instead, I see weird errors. If I specify a single remote, I no longer get any errors, but the docs still don't get deleted. I'm assuming this is an oversight, and that these endpoints don't play well with Cross Cluster ops in the first place. In that case, Optional.empty() is the right value here.
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.
IMO, we should prevent Cross Cluster ops for them like we're planning to do for Fleet searches.
Edit: I just found tickets that track this internally.
server/src/main/java/org/elasticsearch/rest/action/search/RestSearchAction.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/fleet/src/main/java/org/elasticsearch/xpack/fleet/rest/RestFleetSearchAction.java
Show resolved
Hide resolved
.../plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestRollupSearchAction.java
Show resolved
Hide resolved
...n/async-search/src/main/java/org/elasticsearch/xpack/search/RestSubmitAsyncSearchAction.java
Show resolved
Hide resolved
|
Also there aren't many tests added (even including the 2 you did the serverless env). I think I'd like to see details of manual testing of all the REST endpoints changed here to ensure that the ccs_minimize_roundtrips defaults come out as expected and also whether you are allowed to set it. |
I've refreshed the test in the serverless env, and here are the manual testing details: when CPS=true, However, I have a question: does |
Since it already accepts it (even if inappropriately) and rollup-search is not CSP enabled (and IIRC is not exposed in serverless?), we can just leave it as is. |
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.
Clean changes @pawankartik-elastic LGTM!
MRT defaults to
truefor _search andfalsefor _async_search. However, we'd want both to default totruefor CPS.An error is returned should the user try to set the value manually.
Fulfils CPS requirement S2D18.