Skip to content

Adds a page on what the chart lock reaches - #249

Merged
johnnyt merged 1 commit into
mainfrom
sp-0rds-chart-lock-reach-page
Sep 30, 2026
Merged

johnnyt merged 1 commit into
mainfrom
sp-0rds-chart-lock-reach-page

Conversation

@johnnyt

@johnnyt johnnyt commented Sep 30, 2026

Copy link
Copy Markdown
Member

Adds docs/chart-lock.md, a host page on what the per-chart advisory lock reaches, and links it from the README's "Retiring a chart" section and from docs/retention.md. Closes sp-0rds.

The page covers:

  • where the lock is taken (the Ecto adapter over Postgres only) and that it is transaction-scoped;
  • the two modes, shared for every tombstone read and exclusive for a retirement, and a table of what waits on what within one store;
  • the key as merged on main, (namespace, hashtext(store <> " " <> content_hash)), what "the store" is (the chart table under its :prefix), why its unit is the store and not the tenant (the charts table's unique index is on content_hash alone), the prefix-free search_path edge, and the key before this change;
  • the read-then-retire lock upgrade inside a caller's own transaction (a sandboxed test included), with a grep a host runs over its own code and three ways out;
  • parallel test suites: the conformance suite's per-module hash suffix, what the store-scoped key adds, and what neither covers (two processes running one module against one database); a per-checkout default test database for this package is named as a later item;
  • that statifier_router and statifier_oban never choose a host's statifier_persistence version, their lockfiles being their own.

Review (in-turn, docs tier)

Every claim was checked against origin/main at c720da0. The key, both modes and the transaction scope: chart_lock/3, chart_store/1, fetch_retired_info/2 and retire_chart/3 in lib/statifier_persistence/storage/ecto.ex, and @chart_lock_namespace ("SPCH"). The shared read's callers: Storage.check_chart_retired/2 from create/4, migrate/4 and migrate_tree/4 (recheck_retired/2) in lib/statifier_persistence/executions.ex. The unique index on content_hash alone: up/1 in lib/statifier_persistence/ecto/migrations/v01.ex. :prefix as the schema's @schema_prefix and the default table prefix: lib/statifier_persistence/ecto/config.ex and lib/statifier_persistence/ecto.ex. The in-memory adapter's in-transition check: tombstone_on/2 in lib/statifier_persistence/storage/in_memory.ex. The upgrade hazard and its 40P01, and the key's unit, the prefix-free edge and the collision caveat: ADR-0012's 2026-09-29 Note and 2026-09-29 Amendment. The per-module suffix: @conformance_hash_suffix in lib/statifier_persistence/testing/storage_conformance.ex. PGDATABASE: config/test.exs. The sibling requirements: the two sibling repos' mix.exs, read only. The grep on the page was run over this repository and returns matches. The whole diff is additive; no ADR line changes.

Provenance

  • The README and docs/retention.md link the page by its absolute GitHub URL, the way the README already links docs/upgrading.md. A relative link would need the page in mix.exs's docs extras and package files; this change keeps mix.exs untouched, so the page is on GitHub and not in HexDocs. Adding it to the extras is a small follow-up if it should ship in the package docs.
  • The store as the key's unit, not the tenant, was ruled by the operator, 2026-09-29; the page states the reason the retention record's 2026-09-29 Amendment gives.

Gate

Documentation only: no Elixir file changes and no gated path is touched, so there is no local gate to run (the repo's CLAUDE.md commit row). CI runs the full mix quality, including the docs and doc-links stages. No changelog fragment: documentation takes none.

A host running many tenants in one database, or its suite in
parallel shards, asked what the chart advisory lock reaches.
docs/chart-lock.md states the two modes and what waits on what, the
store-scoped key and why its unit is the store and not the tenant,
the prefix-free search_path edge, the read-then-retire upgrade
hazard with a grep a host runs over its own code, parallel test
suites, and that the router and the Oban adapter never choose a
host's version. The README's "Retiring a chart" section and
docs/retention.md link it.

Documentation only: no Elixir file changes, so there is no gate to
run (CLAUDE.md, the commit row).
@johnnyt
johnnyt force-pushed the sp-0rds-chart-lock-reach-page branch from 7830c76 to c29d914 Compare September 30, 2026 06:15
@johnnyt
johnnyt merged commit f9344e2 into main Sep 30, 2026
1 check passed
@johnnyt
johnnyt deleted the sp-0rds-chart-lock-reach-page branch September 30, 2026 06:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant