# ES Delete not freeing up disk space

**URL:** <https://discuss.elastic.co/t/es-delete-not-freeing-up-disk-space/12395>\
**Category:** Elasticsearch\
**Created:** [June 13, 2013, 11:55am UTC](https://discuss.elastic.co/t/es-delete-not-freeing-up-disk-space/12395 "2013-06-13T11:55:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tarang\_dawer](https://avatars.discourse-cdn.com/v4/letter/t/c0e974/32.png) [@tarang\_dawer](https://discuss.elastic.co/u/tarang_dawer)\
**Post date:** [June 13, 2013, 11:55am UTC](https://discuss.elastic.co/t/es-delete-not-freeing-up-disk-space/12395/1 "2013-06-13T11:55:19Z")

</div>

Hi  
I have an index in ES , with 5 shards , 0 replicas and , indexing some data  
with Parent child relationship. The size of the index is 1.1 GB.  
I am setting child document's id, parent , and routing value , as the  
parent's ID , and parent's routing value also the same (to enable , that  
both the documents go to the same shard) .

When i go and delete the child mapping , data is expected to be deleted,  
which is reflected by the REST API (\_Stats/\_status). (shows 957 mb )

But upon checking manually , the disk space was not getting freed up .  
So, i tried optimization . Although the optimization operation response was  
successful, the disk space didn't get free.

By reffering to this link ;-

[http://elasticsearch-users.115913.n3.nabble.com/When-does-ES-free-up-disk-space-td2601270.html](http://elasticsearch-users.115913.n3.nabble.com/When-does-ES-free-up-disk-space-td2601270.html)

i tried using the curl command -

curl -XPOST '192.168.145.117:9200/\_optimize?only\_expunge\_deletes=true'

Although the command was run successfully , but , the response was

{"ok":true,"\_shards":{"total":5,"successful":4,"failed":0}}

1 shard not either successful, nor failed.

I checked the stats/status API, the size it refleced was reduced , but disk  
size was still the same.  
Also , it reflected the same number of shards (successful = 4) .

After deletion when ES shows 4 successful shards , the size of the 5th  
shard is (1.1 GB -957 MB).

Physically , all the 5 shards are present in the data directory. Upon  
restarting the ES instance , it again shows( Stats/Status API) , 5  
successful shards , and the data size is again back to 1.1 GB.

I am using elasticsearch-0.90.0.RC2 .

Please help me .Where am i going wrong ?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [July 6, 2017, 2:31am UTC](https://discuss.elastic.co/t/es-delete-not-freeing-up-disk-space/12395/2 "2017-07-06T02:31:26Z")

</div>


