SuperCache.Cluster.WAL.Store (SuperCache v1.7.0)

Copy Markdown View Source

Owns the Write-Ahead Log ETS tables.

Separating table ownership from SuperCache.Cluster.WAL means the WAL GenServer can crash and restart without losing the pending entries or acknowledgement rows held in ETS. The tables survive as long as this process — and the supervision tree — is alive. They are not durable across a full VM restart, which is an explicit non-goal of the WAL.

Tables

  • SuperCache.Cluster.WAL — WAL entries keyed by sequence number, plus the {:seq, :counter} bookkeeping row.
  • SuperCache.Cluster.WAL_acks — acknowledgement tracking rows.
  • SuperCache.Cluster.WAL_watermarks — per-partition applied-sequence watermarks used to make recovery idempotent.

API

The table names are also available as plain atoms via wal_table/0, ack_table/0, and watermark_table/0 so callers never need to hard-code them.

Summary

Functions

Returns the WAL acknowledgement ETS table name.

Returns a specification to start this module under a supervisor.

Returns the read-your-writes tracking ETS table name.

Starts the WAL store GenServer.

Returns the WAL ETS table name.

Returns the per-partition watermark ETS table name.

Functions

ack_table()

@spec ack_table() :: atom()

Returns the WAL acknowledgement ETS table name.

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

ryw_table()

@spec ryw_table() :: atom()

Returns the read-your-writes tracking ETS table name.

start_link(opts \\ [])

@spec start_link(keyword()) :: {:ok, pid()} | {:error, term()}

Starts the WAL store GenServer.

wal_table()

@spec wal_table() :: atom()

Returns the WAL ETS table name.

watermark_table()

@spec watermark_table() :: atom()

Returns the per-partition watermark ETS table name.