Trellis.SelfCheckReport (Trellis v0.1.0-alpha)

Copy Markdown View Source

What a finished Trellis.self_check/3 job found auditing the whole of a target table against a fresh recompute of its definition from the source.

  • outcome is :converged (every compared cell, row and column matched), :not_caught_up (the target didn't catch up within :timeout_ms; not a verdict on correctness), :not_live (the transform isn't :live, so nothing was awaited or compared; see status), or :diverged (see divergences).
  • status is the transform's status when outcome is :not_live (a rebuild Trellis.request_backfill/2 starts reads :backfilling from the call's return, so poll the status until it is :live, then check again), and nil for every other outcome.
  • divergences lists what differed; it is [] unless outcome is :diverged.
  • rows_compared counts the distinct keys compared.
  • truncated is true when the job stopped before the end of the target's keys: it found 1,000 divergences, or the transform stopped being :live, stopped catching up or lost its capture partway. rows_compared says how far it got.
  • checked_through is the watermark the outcome holds through, a token Trellis.await_converged/3 takes.
  • held_keys is set, whatever the outcome, while the transform holds keys in quarantine (see Trellis.HeldKeys), read when the job is polled: their target rows are ones the audit can't vouch for, and a key with held changes keeps the target from catching up, so the outcome is :not_caught_up until it is released.
  • drain_failures lists, whatever the outcome, every page the drain keeps failing on with nothing charged or paused (see Trellis.DrainFailure), oldest first, whichever transforms read its tables, read when the job is polled; [] when there is none. Each holds back the targets of the tables it holds changes to, and with them the convergence the audit waits on.

Summary

Types

The verdict of a Trellis.self_check/3 job.

t()

Types

outcome()

@type outcome() :: :converged | :not_caught_up | :not_live | :diverged

The verdict of a Trellis.self_check/3 job.

t()

@type t() :: %Trellis.SelfCheckReport{
  checked_through: Trellis.watermark(),
  divergences: [Trellis.Divergence.t()],
  drain_failures: [Trellis.DrainFailure.t()],
  held_keys: Trellis.HeldKeys.t() | nil,
  outcome: outcome(),
  rows_compared: non_neg_integer(),
  status: Trellis.Status.status() | nil,
  target: String.t(),
  truncated: boolean()
}