Ferricstore.Transaction.Coordinator (ferricstore v0.10.0)

Copy Markdown View Source

Transaction coordinator for MULTI/EXEC.

Transactions are accepted only when every routed and watched key belongs to one shard. The complete queue and WATCH snapshot are then checked and applied by that shard's Raft state machine in one ordered entry. Independent Raft groups cannot provide atomic commit through an anchor-group write, so cross-shard transactions fail with CROSSSLOT before mutation.

WATCH conflict detection

WATCH tokens use the key's logical Raft write index when available and a content digest for projected Bitcask values. Capture and validation are both ordered through the owning shard's Raft log.

Summary

Types

queue_entry()

@type queue_entry() :: Ferricstore.Commands.PreparedCommand.t()

Functions

execute(queue, watched_keys, sandbox_namespace)

@spec execute([queue_entry()], %{required(binary()) => term()}, binary() | nil) ::
  [term()] | nil | {:error, binary()}