Not able to get back the space allocated by indices after deleting


(Abhishek) #1

Hi ,

I am using ES 5.5.1 which is running in CentOS on virtual box , where i deleted several indices with huge data but even after deletion am not able to get back the space allocated by them . I got to know that deletion only attaches a DELETE tag to the indices and hence i tried the below cmd as well to free up space :

{curl -XPOST 'http://localhost:9200/_forcemerge?only_expunge_deletes=true }

Any help would be appreciated .

Thanks in advance .


(Bernt Rostad) #2

When you delete documents from an index they are only marked as 'deleted' and won't show up in searches but the disc space won't get reclaimed until a subsequent segment merger, which you can trigger with the _forcemerge command that you listed.

However, if you want to get rid of the entire index it's much better just to run:

curl -XDELETE 'http://localhost:9200/my_old_index'

And this will result in reclaimed disc space immediately.


(Abhishek) #3

I tried _forcemerge command , but it doesnt help .
Also, i had deleted the indices using _head plugin UI and hence dont have the list of the indices that i deleted previously and sounable to use the explicit XDELETE curl .


(Bernt Rostad) #4

I haven't used that plugin myself but from what you wrote earlier, about the disc space not getting reclaimed, it sounds as if no index was actually deleted and that they still exist (though all documents in them may have been marked as deleted).

You can verify if an index still exists by running this curl command

curl -XGET "http://localhost/my_old_index/_settings?pretty"

If you get an index_not_found_exception then there is no such index.


(Val Crettaz) #5

By default, a setting called index.merge.policy.expunge_deletes_allowed sets the the percentage of deleted documents at which the deletion happens. By default, this is set at 10%, so as long as your deleted documents don't amount to 10% of your index, the space won't be reclaimed.

And only_expunge_deletes won't override the above setting.


(system) #6

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