After moving a shard related files do not disappear from the disk

(Carlos Peñas) #1

I have a big index with ~16Gb shards. Recently I moved one of these big shards to less disk constrained node. The storage in the new node was reduced the expected size, and the shard was exchanged by a smaller one. But the disk storage from the parting shard never was recovered. Elastic search version is 2.4

Diggin in elastic search directories I found this

elasticsearch/clustername/nodes/0/indices/indexname$ du -hcx .
8.0K	./_state
8.0K	./1/_state                       <--- shard 0 does not live here
119M	./1/translog
15G	./1/index
15G	./1
8.0K	./2/_state
114M	./2/translog                  
16G	./2/index                       
16G	./2
8.0K	./4/_state                        <--- shard 4 does not live here
13M	./4/translog         
16G	./4/index
16G	./4
8.0K	./3/_state
421M	./3/translog
16G	./3/index
16G	./3
62G	.
62G	total

looking to the shards listings:

curl -s 'http://localhost:9200/_cat/shards?h=n,i,s,p,sto' | grep the_index | sort
node-01 the_index        1 p   14.7gb 
node-01 the_index        2 p   15.8gb 
node-01 the_index        3 r   15.4gb 
node-02 the_index        0 r   16.2gb 
node-02 the_index        2 r   15.7gb 
node-02 the_index        3 p   13.1gb 
node-02 the_index        4 p   18.1gb 
node-03 the_index        0 p   15.1gb 
node-03 the_index        1 r   14.3gb 
node-03 the_index        4 r   18.2gb 

So in node 01 wich is the one I'm looking there is no shard 4 of the index but the files still there.

Is there a way to ask the cluster to do cleanup of these directories ?

(Nik Everett) #2

I ought to remove them when it doesn't need them any more. The usual reason for the files to stick around for a while is that you have a scroll open for the shard that hasn't yet timed out. They ought to vanish once the scroll times out. I'm not sure of a good way to see the count of open contexts now that most of the shard has moved off of the node though.

(system) #3

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