I've started playing around with the _reindex
commands so I can apply new templates without having to wait a month for the indices to cycle through, and one of the things I want to do sometimes is cancel a task.
When I run GET _tasks?actions=*reindex
I get a bunch of tasks back, in this example 3:
{
"nodes": {
"b5UT95DESneKP8DFYCo0qA": {
"name": "instance-0000000014",
"transport_address": "1.2.3.4:19611",
"host": "1.2.3.4",
"ip": "1.2.3.4:19611",
"roles": [
"master",
"data",
"ingest"
],
"attributes": {
"logical_availability_zone": "zone-0",
"availability_zone": "eu-west-1c",
"region": "eu-west-1"
},
"tasks": {
"b5UT95DESneKP8DFYCo0qA:3425854": {
"node": "b5UT95DESneKP8DFYCo0qA",
"id": 3425854,
"type": "transport",
"action": "indices:data/write/reindex",
"start_time_in_millis": 1489579606713,
"running_time_in_nanos": 938362403062,
"cancellable": true
},
"b5UT95DESneKP8DFYCo0qA:3372324": {
"node": "b5UT95DESneKP8DFYCo0qA",
"id": 3372324,
"type": "transport",
"action": "indices:data/write/reindex",
"start_time_in_millis": 1489578556858,
"running_time_in_nanos": 1988217249580,
"cancellable": true
},
"b5UT95DESneKP8DFYCo0qA:3426031": {
"node": "b5UT95DESneKP8DFYCo0qA",
"id": 3426031,
"type": "transport",
"action": "indices:data/write/reindex",
"start_time_in_millis": 1489579610991,
"running_time_in_nanos": 934084989343,
"cancellable": true
}
}
}
}
}
Looking at that, I would have said the task ids were 3425854, 3372324 and 3426031, but when I try to get a single task's details using GET /_tasks/taskId:3425854
I get a "not found" error:
{
"error": {
"root_cause": [
{
"type": "index_not_found_exception",
"reason": "no such index",
"resource.type": "index_expression",
"resource.id": ".tasks",
"index_uuid": "_na_",
"index": ".tasks"
}
],
"type": "resource_not_found_exception",
"reason": "task [taskId:3425854] belongs to the node [taskId] which isn't part of the cluster and there is no record of the task",
"caused_by": {
"type": "resource_not_found_exception",
"reason": "task [taskId:3425854] isn't running and hasn't stored its results",
"caused_by": {
"type": "index_not_found_exception",
"reason": "no such index",
"resource.type": "index_expression",
"resource.id": ".tasks",
"index_uuid": "_na_",
"index": ".tasks"
}
}
},
"status": 404
}