Adding a migration reindex cancel API#118291
Adding a migration reindex cancel API#118291elasticsearchmachine merged 23 commits intoelastic:mainfrom
Conversation
|
Hi @masseyke, I've created a changelog YAML for you. |
|
Pinging @elastic/es-data-management (Team:Data Management) |
| @Override | ||
| public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { | ||
| builder.startObject(); | ||
| builder.field("acknowledged", true); |
There was a problem hiding this comment.
Could this action just use AcknowledgeResponse directly?
There was a problem hiding this comment.
Oh yeah, it could! In an early iteration I was returning the latest status information so the response had fields in it. But then I decided that was unnecessary and forgot to remove the response class.
| ) | ||
| ); | ||
| } else { | ||
| runningTask.markAsCompleted(); |
There was a problem hiding this comment.
So is this all that's needed to cancel the actual reindex code? Or does there need to be cancel specific logic built into the per-index reindexing code, which will be called here?
There was a problem hiding this comment.
It sounds like markAsCompleed is the wrong way to go. I'm going to change this to use PersistentTasksService::sendRemoveRequest instead. And we just need to make sure the parent task is set on all of our transport actions to have the cancellation propagate.
…eyke/elasticsearch into adding-migration-reindex-cancel-api
| * the task manager). The running task is removed from the task manager in ReindexDataStreamTask::onCancelled, which is called as | ||
| * as result of this. | ||
| */ | ||
| persistentTasksService.sendRemoveRequest(persistentTaskId, TimeValue.MAX_VALUE, new ActionListener<>() { |
There was a problem hiding this comment.
nit, could do:
listener.delegateResponse((l, e) -> l.onResponse(AcknowledgedResponse.TRUE))
This introduces the migration reindex cancel API, which cancels a migration reindex task for a given data stream name that was started with elastic#118109. For example: ``` POST localhost:9200/_migration/reindex/my-data-stream/_cancel?pretty ``` returns ``` { "acknowledged" : true } ``` This cancels the task, and cancels any ongoing reindexing of backing indices, but does not do any cleanup.
This introduces the migration reindex cancel API, which cancels a migration reindex task for a given data stream name that was started with #118109. For example: ``` POST localhost:9200/_migration/reindex/my-data-stream/_cancel?pretty ``` returns ``` { "acknowledged" : true } ``` This cancels the task, and cancels any ongoing reindexing of backing indices, but does not do any cleanup.
This introduces the migration reindex cancel API, which cancels a migration reindex task for a given data stream name that was started with elastic#118109. For example: ``` POST localhost:9200/_migration/reindex/my-data-stream/_cancel?pretty ``` returns ``` { "acknowledged" : true } ``` This cancels the task, and cancels any ongoing reindexing of backing indices, but does not do any cleanup.
This introduces the migration reindex cancel API, which cancels a migration reindex task for a given data stream name that was started with #118109. For example:
returns
This cancels the task, and cancels any ongoing reindexing of backing indices, but does not do any cleanup.