Add disabled POST _reindex/{taskId}/_cancel API#139211
Conversation
...agement/src/main/java/org/elasticsearch/reindex/management/TransportCancelReindexAction.java
Show resolved
Hide resolved
...agement/src/main/java/org/elasticsearch/reindex/management/TransportCancelReindexAction.java
Show resolved
Hide resolved
modules/reindex/src/main/java/org/elasticsearch/reindex/TransportCancelReindexAction.java
Outdated
Show resolved
Hide resolved
modules/reindex/src/main/java/org/elasticsearch/reindex/ReindexPlugin.java
Outdated
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 |
modules/reindex/src/main/java/org/elasticsearch/reindex/RestCancelReindexAction.java
Outdated
Show resolved
Hide resolved
* 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)
...
There was a problem hiding this comment.
Pull request overview
This PR introduces a new POST /_reindex/{taskId}/_cancel API endpoint for canceling in-flight reindex tasks. The functionality is hidden behind the reindex_resilience feature flag to allow development without affecting releases. The implementation includes transport and REST layers for the cancel operation, with comprehensive integration tests covering synchronous/asynchronous cancellation scenarios.
- Adds core functionality for a new reindex cancellation API endpoint
- Implements task filtering logic to validate and cancel reindex tasks
- Includes end-to-end integration tests for various cancellation scenarios
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| Constants.java | Adds new reindex cancel action to operator privileges list |
| TransportCancelReindexAction.java | Core transport action implementing reindex task cancellation logic |
| RestCancelReindexAction.java | REST handler for the POST /_reindex/{taskId}/_cancel endpoint |
| ReindexPlugin.java | Registers new action handlers and REST handlers behind feature flag |
| CancelReindexTaskResponse.java | Response object for individual task cancel operations |
| CancelReindexResponse.java | Response object for the cancel API endpoint |
| CancelReindexRequest.java | Request object containing cancellation parameters |
| ReindexCancelIT.java | Integration tests for the cancel endpoint functionality |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
modules/reindex/src/main/java/org/elasticsearch/reindex/TransportCancelReindexAction.java
Outdated
Show resolved
Hide resolved
modules/reindex/src/internalClusterTest/java/org/elasticsearch/reindex/ReindexCancelIT.java
Outdated
Show resolved
Hide resolved
modules/reindex/src/internalClusterTest/java/org/elasticsearch/reindex/ReindexCancelIT.java
Outdated
Show resolved
Hide resolved
* upstream/main: (253 commits) Adds ST_SIMPLIFY geo spatial function (elastic#136309) Take control of max clause count verification in Lucene searcher (elastic#139752) [ML] Unmute Inference Test (elastic#139765) Parameterize the vector operation benchmark tests (elastic#139735) Fix node reduction pushdown tests for release tests (elastic#139548) Fix flakiness in TSDataGenerationHelper (elastic#139759) CPS: Copy existing resolved index expressions when constructing a new `SearchRequest` from an existing one (elastic#139596) Add release notes for v9.1.9 release (elastic#139674) Add lucene query for wildcards on high cardinality keyword fields. (elastic#139746) Suppress Tika entitlement warnings from AWT (elastic#139711) Check field storage when synthetic source is enabled, in tests (elastic#139715) Refactor VectorSimilarityType to know about its corresponding Function (elastic#139678) Merge fixes from patch branch back into main (elastic#139721) Define native bulk operations for vector square distance (elastic#139198) Use LongUpDownCounter for Linked Project Error Metrics (elastic#139657) ESQL: Add javadoc that explains version-aware planning (elastic#139706) Add helper to pick node for reindex relocation (elastic#139081) Fix auth serialization randomized version test (elastic#139182) ES|QL - Add parsing, preanalysis and analysis timing information to profile (elastic#139540) Mute org.elasticsearch.persistent.ClusterPersistentTasksCustomMetadataTests testMinVersionSerialization elastic#139741 ...
* upstream/main: (25 commits) Add spec for project routing CRUD REST API endpoints (elastic#139634) Implement AllSupportedFIeldsTestCase for TDigest (elastic#139744) Mute elastic#139802 (elastic#139803) fix(logsdb): batch bulk indexing to prevent OOM in challenge tests (elastic#139770) Documentation for semantic_text auto pre-filtering (elastic#139749) Always do bulk scoring for rescoring when possible (elastic#139777) Optimize script sorts that do not require query scores (elastic#139748) Bump versions after 9.1.9 release Update branches.json for 9.1.9 release Bump versions after 9.2.3 release Prune changelogs after 8.19.9 release Bump versions after 8.19.9 release Update branches.json for 8.19.9 release Finalize docs for v9.2.3 release (elastic#139795) ESQL: Added timezone support to date_format and date_parse (elastic#138517) Update branches.json for 9.2.3 release Finalize docs for v9.1.9 release (elastic#139796) Switch inline stats to GA in docs (elastic#139753) Validate license in CPS (elastic#139105) FIPS 140-3 support with BC FIPS 2.0.x (elastic#139319) ...
...x-management/src/main/java/org/elasticsearch/reindex/management/RestCancelReindexAction.java
Outdated
Show resolved
Hide resolved
...ement/src/internalClusterTest/java/org/elasticsearch/reindex/management/ReindexCancelIT.java
Show resolved
Hide resolved
...ement/src/internalClusterTest/java/org/elasticsearch/reindex/management/ReindexCancelIT.java
Show resolved
Hide resolved
...ndex-management/src/main/java/org/elasticsearch/reindex/management/CancelReindexRequest.java
Outdated
Show resolved
Hide resolved
...ndex-management/src/main/java/org/elasticsearch/reindex/management/CancelReindexRequest.java
Show resolved
Hide resolved
...agement/src/main/java/org/elasticsearch/reindex/management/TransportCancelReindexAction.java
Outdated
Show resolved
Hide resolved
...agement/src/main/java/org/elasticsearch/reindex/management/TransportCancelReindexAction.java
Outdated
Show resolved
Hide resolved
...agement/src/main/java/org/elasticsearch/reindex/management/TransportCancelReindexAction.java
Show resolved
Hide resolved
...ement/src/internalClusterTest/java/org/elasticsearch/reindex/management/ReindexCancelIT.java
Show resolved
Hide resolved
...ement/src/internalClusterTest/java/org/elasticsearch/reindex/management/ReindexCancelIT.java
Show resolved
Hide resolved
...ement/src/internalClusterTest/java/org/elasticsearch/reindex/management/ReindexCancelIT.java
Show resolved
Hide resolved
...ndex-management/src/main/java/org/elasticsearch/reindex/management/CancelReindexRequest.java
Show resolved
Hide resolved
...ndex-management/src/main/java/org/elasticsearch/reindex/management/CancelReindexRequest.java
Show resolved
Hide resolved
...x-management/src/main/java/org/elasticsearch/reindex/management/RestCancelReindexAction.java
Outdated
Show resolved
Hide resolved
...agement/src/main/java/org/elasticsearch/reindex/management/TransportCancelReindexAction.java
Outdated
Show resolved
Hide resolved
* upstream/main: (191 commits) Overall Decision for Deciders prioritizes THROTTLE (elastic#140237) Apply group by all logic not only to top-level aggregates (elastic#140248) [ES|QL] Refactor MV_UNION and MV_INTERSECTION to use shared set operation helper (elastic#139982) Avoid reading entire bloom filter file on reader open (elastic#139374) Mark bloom filter files for random access (elastic#139375) Ensure that the buffer used for ES93BloomFilterStoredFieldsFormat is zeroed (elastic#139034) Add busy assertion to avoid race condition for testStalledShardMigrationProperlyDetected (elastic#140230) Remove line number check for testTransitiveFindsDeepCallChain (elastic#140228) Allow a slight difference in rescored docs (elastic#139931) Mute org.elasticsearch.xpack.inference.integration.AuthorizationTaskExecutorIT testCreatesEisChatCompletion_DoesNotRemoveEndpointWhenNoLongerAuthorized elastic#138480 Start exchange sink fetchers concurrently (elastic#140196) Allow allocation to replacement target node on vacate completion (elastic#140150) Ignore JNA cleaner threads in SecureHdfsRepositoryAnalysisRestIT (elastic#139925) DeterministicQueue refactor and enhancement (elastic#140151) Always error out if CCS expression shows up when CCS is not supported (elastic#139009) Use IllegalArgumentException over RepositoryException for readonly-repository checks (elastic#140200) Guard promql capabilities in AnalyzerTests (elastic#140232) [Inference API] Fix flaky AuthorizationTaskExecutorIT tests (elastic#139978) Cleaning up exitable vector value impls (elastic#140190) [Inference API] Fix auth exception listener not called bug (elastic#139966) ...
rest-api-spec/src/main/resources/rest-api-spec/api/reindex.cancel.json
Outdated
Show resolved
Hide resolved
* upstream/main: Add hook for blocking termination (elastic#133555) Delegate to ES93ScalarQuantizedVectorsFormat rather than copying behaviour (elastic#139834) Refactor compound block types (elastic#140219) Flush the rate buffer when the slice index changes (elastic#138856) Log linked project connection errors at debug during shutdown (elastic#140239) Periodic FIPS 140-3 buildkite pipelines (elastic#139909) ES|QL - Remove TERM function (elastic#139953) Fix name of started time field in shutdown status (elastic#139910) Drop `project_routing` from query params (elastic#140272) Fix flaky test: AllocationDecidersTests (elastic#140271) Add List Reindex API (elastic#140184) Expose _tier metadata attribute in ESQL (elastic#139894) Tweak TSDBRestEsqlIT#testTimeSeriesQuerying(...) (elastic#140210) Fix an OOM error when creating to many chained synonym graph token filter. (elastic#140026) Suppress Azure SDK error logs (elastic#139730) Rewritten integer sorts need to use SortedNumericSortField (elastic#139538) (elastic#139700) Adjust index versions for skippers for time series (elastic#139670) Fix host.name skippers index version range (elastic#139636) Remove BWC shim for a broken commit Fix index.mapping.use_doc_values_skipper defaults in serverless (elastic#139532)
|
some release tests are failing that don't seem at all related, and seem to fail on other PRs... assuming safe to proceed... |
PeteGillinElastic
left a comment
There was a problem hiding this comment.
This is mostly looking good. There's a couple of small-ish suggestions which occurred to me looking at it with fresh eyes. (You probably want to read the second one first.)
Are you planning on doing the TODOs in this PR or in one or more follow-ups?
...agement/src/main/java/org/elasticsearch/reindex/management/TransportCancelReindexAction.java
Outdated
Show resolved
Hide resolved
...ndex-management/src/main/java/org/elasticsearch/reindex/management/CancelReindexRequest.java
Show resolved
Hide resolved
@PeteGillinElastic more follow-ups... i think PR has enough comments |
samxbr
left a comment
There was a problem hiding this comment.
Approving as follow ups will be done in separate PR
* upstream/main: (76 commits) [Inference API] Get _services skips EIS authorization call if CCM is not configured (elastic#139964) Improve TSDB codec benchmarks with full encoder and compression metrics (elastic#140299) ESQL: Consolidate test `BlockLoaderContext`s (elastic#140403) ESQL: Improve Lookup Join performance with CachedDirectoryReader (elastic#139314) ES|QL: Add more examples for the match operator (elastic#139815) ESQL: Add timezone to add and sub operators, and ConfigurationAware planning support (elastic#140101) ESQL: Updated ToIp tests and generated documentation for map parameters (elastic#139994) Disable _delete_by_query and _update_by_query for CCS/stateful (elastic#140301) Remove unused method ElasticInferenceService.translateToChunkedResults (elastic#140442) logging hot threads on large queue of the management threadpool (elastic#140251) Search functions docs cleanup (elastic#140435) Unmute 350_point_in_time/point-in-time with index filter (elastic#140443) Remove unused methods (elastic#140222) Add CPS and `project_routing` support for `_mvt` (elastic#140053) Streamline `ShardDeleteResults` collection (elastic#140363) Fix Docker build to use --load for single-platform images (elastic#140402) Parametrize + test VectorScorerOSQBenchmark (elastic#140354) `RecyclerBytesStreamOutput` using absolute offsets (elastic#140303) Define bulk float native methods for vector scoring (elastic#139885) Make `TimeSeriesAggregate` `TimestampAware` (elastic#140270) ...
PeteGillinElastic
left a comment
There was a problem hiding this comment.
LGTM, on the proviso that the remaining bits will happen in follow-up PRs. Thanks @szybia !
?wait_for_completion=trueasGET _reindex/{taskId}: Cancel reindex returns same response as GET #140626Closes elastic/elasticsearch-team#2086