Ferricstore.Cluster.Recovery (ferricstore v0.11.9)

Copy Markdown View Source

Reports whether the local cluster replica has caught up with every shard leader.

This is intentionally stricter than ordinary HTTP readiness. It is used by rolling infrastructure deployments before another replica is stopped, so a freshly replaced node with an empty local disk is not mistaken for a fully recovered replica merely because it has connected and found a leader.

Summary

Functions

Returns true when this node is connected and caught up on every shard.

Returns local recovery details suitable for deployment diagnostics.

Types

shard_status()

@type shard_status() :: %{
  :ready => boolean(),
  optional(:leader) => node(),
  optional(:local_index) => non_neg_integer(),
  optional(:leader_index) => non_neg_integer(),
  optional(:lag_entries) => non_neg_integer(),
  optional(:reason) => term()
}

Functions

ready?(opts \\ [])

@spec ready?(keyword()) :: boolean()

Returns true when this node is connected and caught up on every shard.

status(opts \\ [])

@spec status(keyword()) :: %{
  ready: boolean(),
  connected_nodes: [node()],
  shards: map()
}

Returns local recovery details suitable for deployment diagnostics.