RaftFleet.ProcessAndDiskLogIndexInspector (raft_fleet v0.11.0)

Copy Markdown View Source

A GenServer that reports "eligibility" of a node for hosting the 1st member of a new consensus group.

When starting a new consensus group, a manager process collects reports from all active nodes and determine where to spawn the 1st member process. The report includes:

  • whether there exists a process whose registered name equals to the consensus group name
  • last log index in locally stored files (if any)

Summary

Functions

Returns a specification to start this module under a supervisor.

Callback implementation for GenServer.init/1.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

find_node_having_latest_log_index(name)

@spec find_node_having_latest_log_index(atom()) ::
  {:ok, nil | node()} | {:error, :process_exists}

init(atom)

Callback implementation for GenServer.init/1.

start_link(arg0)

@spec start_link([]) :: {:ok, pid()}