It some cases, it's very interesting to know which shards are currently relocating and also the current progress of such operations. E.g.
- in rolling restarts as shard relocations will defer the restart
- when scaling up/down
- initial shard recovery on node start up
- ...
A common query used to see shards which are currently relocating or initializing is:
select node['name'], id, recovery['stage'], recovery['size'], routing_state, state, primary, table_name, relocating_node, size / 1024^3 as size_gb, partition_ident
from sys.shards
where routing_state in ('RELOCATING', 'INITIALIZING')
order by id;
At least for relocating shards, it should be possible to know the current progress. Not sure if this is feasible on initial recovery as the final sizes or maximum sequence numbers may not be known upfront.
Implementing an internal command which directly gives a user the current state without the need to know such system queries could help a lot.
It some cases, it's very interesting to know which shards are currently relocating and also the current progress of such operations. E.g.
A common query used to see shards which are currently relocating or initializing is:
At least for relocating shards, it should be possible to know the current progress. Not sure if this is feasible on initial recovery as the final sizes or maximum sequence numbers may not be known upfront.
Implementing an internal command which directly gives a user the current state without the need to know such system queries could help a lot.