# DELETE elasticsearch index while running the reindex task on the same index

**URL:** <https://discuss.elastic.co/t/delete-elasticsearch-index-while-running-the-reindex-task-on-the-same-index/225357>\
**Category:** Elasticsearch\
**Created:** [March 27, 2020, 8:14am UTC](https://discuss.elastic.co/t/delete-elasticsearch-index-while-running-the-reindex-task-on-the-same-index/225357 "2020-03-27T08:14:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kareemulla\_Dudekula](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kareemulla_dudekula/32/65169_2.png) [@Kareemulla\_Dudekula](https://discuss.elastic.co/u/Kareemulla_Dudekula)\
**Post date:** [March 27, 2020, 8:14am UTC](https://discuss.elastic.co/t/delete-elasticsearch-index-while-running-the-reindex-task-on-the-same-index/225357/1 "2020-03-27T08:14:43Z")

</div>

Hi,  
I would like to know what will happen If I am trying to delete the elasticsearch index when the reindex task in progress..

Is it through the error?  
it will suspend the reindex task and delete the index?  
Is delete index will wait for the completion of the reindex task then immediately the index will delete?

`curl -X DELETE localhost:9200/source_index?pretty`

`curl -X POST localhost:9200/_reindex -d '{ "source" : { "index" : "source_index" }, "dest" : { "index" : "dest_index" }}'`

---

<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:** [March 27, 2020, 8:56am UTC](https://discuss.elastic.co/t/delete-elasticsearch-index-while-running-the-reindex-task-on-the-same-index/225357/2 "2020-03-27T08:56:16Z")

</div>

Welcome!

Why would you want to do such a thing?

BTW please format your code, logs or configuration files using `</>` icon as explained in [this guide](https://discuss.elastic.co/t/about-the-elasticsearch-category/21) and not the citation button. It will make your post more readable.

Or use markdown style like:

````
```
CODE
```

````

This is the icon to use if you are not using markdown format:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/e/7e6e239431ec2d71cbf1beef741f2e93e7cc762c.jpg)

There's a live preview panel for exactly this reasons.

Lots of people read these forums, and many of them will simply skip over a post that is difficult to read, because it's just too large an investment of their time to try and follow a wall of badly formatted text.  
If your goal is to get an answer to your questions, it's in your interest to make it as easy to read and understand as possible.

---

<div class="post-metadata">

**Author:** ![Kareemulla\_Dudekula](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kareemulla_dudekula/32/65169_2.png) [@Kareemulla\_Dudekula](https://discuss.elastic.co/u/Kareemulla_Dudekula)\
**Post date:** [March 27, 2020, 9:33am UTC](https://discuss.elastic.co/t/delete-elasticsearch-index-while-running-the-reindex-task-on-the-same-index/225357/3 "2020-03-27T09:33:30Z")

</div>

I have an es index which is taking more than 10 hrs for reindexing. In the situation like when the reindex is in progress at that time I have a schedule time for the db refresh which is involved delete index. So, I just want to know If I do commit to do refresh when the reindex is in progress what will happen.

---

<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:** [March 27, 2020, 2:36pm UTC](https://discuss.elastic.co/t/delete-elasticsearch-index-while-running-the-reindex-task-on-the-same-index/225357/4 "2020-03-27T14:36:14Z")

</div>

I never tried such a thing but it should not be hard to simulate and see what is happening.  
I'm not sure if the DELETE index operation is waiting for any scroll operation or not.

But I'm wondering what is the global picture of your design. Why are you reindexing every day? Why are you dropping the index everyday? Could you explain a bit more about your use case?

---

<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:** [April 24, 2020, 2:36pm UTC](https://discuss.elastic.co/t/delete-elasticsearch-index-while-running-the-reindex-task-on-the-same-index/225357/5 "2020-04-24T14:36:23Z")

</div>

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