Ferricstore.Raft.CommandClock (ferricstore v0.10.1)

Copy Markdown View Source

Stamps Raft commands with one leader-side HLC and wall-clock snapshot before they enter the log.

The state machine uses both values for TTL and lock-expiry decisions, making clock-drift rejection deterministic across replicas.

Summary

Types

hlc_ts()

@type hlc_ts() :: {non_neg_integer(), non_neg_integer()}

stamped_command()

@type stamped_command() ::
  {term(), %{hlc_ts: hlc_ts(), wall_time_ms: non_neg_integer()}}

Functions

pipeline_command(shard_id, command, corr, priority)

@spec pipeline_command(term(), term(), reference() | integer(), atom()) :: term()

process_command(shard_id, command)

@spec process_command(term(), term()) :: term()

process_command(shard_id, command, opts)

@spec process_command(term(), term(), term()) :: term()

stamp(command)

@spec stamp(term()) :: stamped_command()

to_ttb(command)

@spec to_ttb(term()) :: {:ttb, binary()}