-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Add disabled POST _reindex/{taskId}/_cancel API
#139211
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
| } | ||
|
|
||
| final var response = new CancelReindexResponse(taskFailures, nodeExceptions); | ||
| response.rethrowFailures("cancel_reindex"); // if we haven't handled any exception already, throw 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.
mainly means a HTTP 500
i can't think of other failures to handle, but assume it's fine if we run into something and we fix it to be handled later rather than passively returning a 200 with failure in response or something
|
|
||
| taskManager.cancelTaskAndDescendants( | ||
| task, | ||
| CancelTasksRequest.DEFAULT_REASON, |
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.
public static final String DEFAULT_REASON = "by user request";
| final TaskId taskId = request.getTargetTaskId(); | ||
| assert taskId.isSet() : "task id must be provided"; | ||
|
|
||
| final CancellableTask task = taskManager.getCancellableTask(taskId.getId()); |
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.
UTs incoming for this filtering logic...
modules/reindex/src/main/java/org/elasticsearch/reindex/ReindexPlugin.java
Show resolved
Hide resolved
654cb1d to
10bf116
Compare
|
Pinging @elastic/es-distributed-indexing (Team:Distributed Indexing) |
|
note to self: test that my ITs are skipped in release build by applying label |
| throw new IllegalArgumentException("invalid taskId provided: " + taskIdParam); | ||
| } | ||
|
|
||
| final ProjectId projectId = client.projectResolver().getProjectId(); |
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.
There had been discussion before on whether to expose project id at the rest layer, and I think we didn't have a settlement yet before the multi-project project was paused. But if I remember correctly the tentative general guidance was to push the multi project resolving to the transport layer if possible. It saves the boilerplate for project id in all the requests.
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.
that makes sense, given headers seem to be transmitted with every transport request anyway
* upstream/main: (79 commits)
Mute org.elasticsearch.test.rest.yaml.CcsCommonYamlTestSuiteIT test {p0=search/140_pre_filter_search_shards/prefilter on non-indexed date fields} elastic#139381
Adjust error bounds for bfloat16 value checks (elastic#139371)
Unmute some vector CSS tests (elastic#139370)
Do not allow `project_routing` as a query param (elastic#139206)
Unmute HalfFloat...Tests#testSynthesizeArrayRandom (elastic#139341)
Remove leniency in LinkedProjectConfig builder methods (elastic#139012)
EQL: fix project_routing (elastic#139366)
Add patch version for 9.2 index version constant (elastic#139362)
Mute org.elasticsearch.test.rest.yaml.RcsCcsCommonYamlTestSuiteIT test {p0=search.vectors/200_dense_vector_docvalue_fields/dense_vector docvalues with bfloat16} elastic#139368
ES|QL: Enable CCS tests for FORK (elastic#139302)
Restructuring the semantic_text field type page (elastic#138571)
AggregateMetricDouble fields should not build BKD indexes (elastic#138724)
Feature/count by trunc with filter (elastic#138765)
ESQL: Convert TS 500 error to 400 (elastic#139360)
[CI] Rerun failing tests for periodic build pipelines (elastic#139200)
revert muting saml test (elastic#139327)
Add TDigest histogram as metric (elastic#139247)
Links solved bugs to class cast exception changelog and unmutes errors (elastic#139340)
Ensure integer sorts are rewritten to long sorts for BWC indexes (elastic#139293)
Integrate stored fields format bloom filter with synthetic _id (elastic#138515)
...
?wait_for_completion=trueas incomingGET _reindex/{taskId}behavior when we cancel a non-running taskLet me know if there's any other action items I haven't considered :)