Getting informed of moving shards in the cluster

Hi,

is there any possibility to get informed, when a shard is moved from
one instance to another or when it is being deleted? I'd like to free
up some in-memory resources in case that happens in my
AbstractIndexShardComponent.

Regards, Alexander

--

Alexander,

For the former, you probably can poll the cluster state for reallocating
shards. Not very efficient, but since shard reallocation can take some time
for non-trivial indices (large shards), the polling interval can be large.

Deletions would be tough. When exactly is a shard deleted in Elasticsearch?
The only scenario I can think of is during a reallocation (copy and
deleted) and when the numbers of replicas is reduced (which is under user
control).

--
Ivan

On Wed, Oct 3, 2012 at 2:43 AM, Alexander Reelsen alr@spinscale.de wrote:

Hi,

is there any possibility to get informed, when a shard is moved from
one instance to another or when it is being deleted? I'd like to free
up some in-memory resources in case that happens in my
AbstractIndexShardComponent.

Regards, Alexander

--

--

Hi Alexander,

I think I asked about this once on the ML and I think I subsequently opened
an issue on Github.

Otis

Search Analytics - Cloud Monitoring Tools & Services | Sematext
Performance Monitoring - http://sematext.com/spm/index.htm

On Wednesday, October 3, 2012 5:43:15 AM UTC-4, Alexander Reelsen wrote:

Hi,

is there any possibility to get informed, when a shard is moved from
one instance to another or when it is being deleted? I'd like to free
up some in-memory resources in case that happens in my
AbstractIndexShardComponent.

Regards, Alexander

--

Hi

On Wed, Oct 3, 2012 at 10:21 PM, Otis Gospodnetic
otis.gospodnetic@gmail.com wrote:

I think I asked about this once on the ML and I think I subsequently opened
an issue on Github.
Hm. What about IndicesLifecycle.Listener.beforeIndexShardClosed() -
which seems to do what I just want. It even handles deletes
differently.

Calling this should be enough:
indicesService.indicesLifecycle().addListener(new Listener() { /*
yadayadayada */ })

there is also a shardRoutingChanged() method... so I can catch deleted
and shard moves (which in the end will likely also issue an delete on
the shard moved, everything fine for me).

--Alexander

--