Skip to content

Add internal command to watch shard relocations progresses #493

@seut

Description

@seut

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions