# How do i cancel an ongoing reindex operation?

**URL:** <https://discuss.elastic.co/t/how-do-i-cancel-an-ongoing-reindex-operation/155383>\
**Category:** Elasticsearch\
**Created:** [November 5, 2018, 10:53am UTC](https://discuss.elastic.co/t/how-do-i-cancel-an-ongoing-reindex-operation/155383 "2018-11-05T10:53:42Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jacobot](https://avatars.discourse-cdn.com/v4/letter/j/4491bb/32.png) [@jacobot](https://discuss.elastic.co/u/jacobot)\
**Post date:** [November 5, 2018, 10:53am UTC](https://discuss.elastic.co/t/how-do-i-cancel-an-ongoing-reindex-operation/155383/1 "2018-11-05T10:53:42Z")

</div>

How do i cancel an ongoing re-index operation?

I am reindexing it seems 118million documents (at 5000 doc/sec) this would take 6 hours in hindsight

How can i cancel this operation?

Cheers  
Jacob

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [November 5, 2018, 11:07am UTC](https://discuss.elastic.co/t/how-do-i-cancel-an-ongoing-reindex-operation/155383/2 "2018-11-05T11:07:26Z")

</div>

Have a look at the task management API. You should see the reindex task which you can then cancel.

---

<div class="post-metadata">

**Author:** ![jacobot](https://avatars.discourse-cdn.com/v4/letter/j/4491bb/32.png) [@jacobot](https://discuss.elastic.co/u/jacobot)\
**Post date:** [November 5, 2018, 11:34am UTC](https://discuss.elastic.co/t/how-do-i-cancel-an-ongoing-reindex-operation/155383/3 "2018-11-05T11:34:20Z")

</div>

I have used the task api to cancel ,there are 2 ongoing tasks i cannot cancel, is there a way to forcable cancel, because i have calculated the indexing rate and amount of documents and it would take several hours if i let them complete.

cheers  
Jacob

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [November 5, 2018, 11:52am UTC](https://discuss.elastic.co/t/how-do-i-cancel-an-ongoing-reindex-operation/155383/4 "2018-11-05T11:52:55Z")

</div>

IIRC once you trigger a cancel call, it's not done immediately but have to wait for one of the partial run to end. ie if reindex is done 10000 by 10000, it needs to wait for processing one of those 10000 docs runs.

What is the output of:

```auto
GET _tasks?actions=*reindex&detailed

```

---

<div class="post-metadata">

**Author:** ![jacobot](https://avatars.discourse-cdn.com/v4/letter/j/4491bb/32.png) [@jacobot](https://discuss.elastic.co/u/jacobot)\
**Post date:** [November 5, 2018, 11:55am UTC](https://discuss.elastic.co/t/how-do-i-cancel-an-ongoing-reindex-operation/155383/5 "2018-11-05T11:55:47Z")

</div>

Hi, the output of your request is

> GET \_tasks?actions=\*reindex&detailed

```json
{
  "nodes": {}
}

```

However if I run

> GET \_tasks

I get

```json
{
  "nodes": {
    "43aC6EGzRkCQC5aB3-BZHA": {
      "name": "43aC6EG",
      "transport_address": "172.20.0.2:9300",
      "host": "172.20.0.2",
      "ip": "172.20.0.2:9300",
      "roles": [
        "master",
        "data",
        "ingest"
      ],
      "attributes": {
        "ml.machine_memory": "4143083520",
        "xpack.installed": "true",
        "ml.max_open_jobs": "20",
        "ml.enabled": "true"
      },
      "tasks": {
        "43aC6EGzRkCQC5aB3-BZHA:30664555": {
          "node": "43aC6EGzRkCQC5aB3-BZHA",
          "id": 30664555,
          "type": "direct",
          "action": "cluster:monitor/tasks/lists[n]",
          "start_time_in_millis": 1541418905547,
          "running_time_in_nanos": 95368,
          "cancellable": false,
          "parent_task_id": "43aC6EGzRkCQC5aB3-BZHA:30664554",
          "headers": {}
        },
        "43aC6EGzRkCQC5aB3-BZHA:30664554": {
          "node": "43aC6EGzRkCQC5aB3-BZHA",
          "id": 30664554,
          "type": "transport",
          "action": "cluster:monitor/tasks/lists",
          "start_time_in_millis": 1541418905547,
          "running_time_in_nanos": 280777,
          "cancellable": false,
          "headers": {}
        }
      }
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [November 5, 2018, 12:06pm UTC](https://discuss.elastic.co/t/how-do-i-cancel-an-ongoing-reindex-operation/155383/6 "2018-11-05T12:06:53Z")

</div>

So there is no more reindex task operation in progress.

---

<div class="post-metadata">

**Author:** ![jacobot](https://avatars.discourse-cdn.com/v4/letter/j/4491bb/32.png) [@jacobot](https://discuss.elastic.co/u/jacobot)\
**Post date:** [November 5, 2018, 12:11pm UTC](https://discuss.elastic.co/t/how-do-i-cancel-an-ongoing-reindex-operation/155383/7 "2018-11-05T12:11:37Z")

</div>

@dadoonet,  
Thank you very much, i indeed see this in kibana monitors,

cheers  
Jacob

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 3, 2018, 12:11pm UTC](https://discuss.elastic.co/t/how-do-i-cancel-an-ongoing-reindex-operation/155383/8 "2018-12-03T12:11:46Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
