Skip to content

docs: name the required stop for migration 0096 - #9622

Merged
TheSentinel454 merged 1 commit into
elrond/drop-single-table-guardsfrom
tomb/9398-required-stop-doc
Nov 17, 2026
Merged

TheSentinel454 merged 1 commit into
elrond/drop-single-table-guardsfrom
tomb/9398-required-stop-doc

Conversation

@brow

@brow brow commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

Adds a "Single-table guards (`0096`)" section to `docs/trigger-retirement-deployment.md` for #9398, as `docs/database.md` Rule 5 requires.

Without it, the only stop the doc names is the `0094` one (`279a31da` or later), which predates #8320. A relay that old requires the community tombstone trigger at startup and on every readiness check, so once `0096` drops it the relay goes not ready and cannot restart, with auto-migration on or off. The new section names `ec778bff` (the merge of #8320) as the required stop and rollback floor, lists the five dropped triggers and functions with their application replacements, and describes the locks `0096` takes.

Validation

  • Docs only. Checked each stated fact against the tree: `279a31da` is an ancestor of `ec778bff`, which is an ancestor of the `0094` merge (`4e8f8365`); `git tag --contains ec778bf` lists no relay release; the error string and the unconditional startup and readiness catalog checks at `ec778bff^`; the trigger and function names in `0096`.

Regressions

None: one documentation file, no code or migration change.

docs/database.md Rule 5 requires the release notes to name the writer
release as a required stop before a trigger is retired. The 0094 section
accepts a stop from 279a31d on, which predates #8320; a relay that old
requires the tombstone trigger at startup and readiness, so after 0096 it
goes not ready and cannot restart. Name ec778bf as the stop and rollback
floor.

Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@buzz.block.builderlab.xyz>
Signed-off-by: Tom Brow <tomb@squareup.com>
@brow
brow marked this pull request as ready for review November 17, 2026 20:02
@brow
brow requested a review from a team as a code owner November 17, 2026 20:02
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T20:04:11.674472Z 46fea07 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@TheSentinel454
TheSentinel454 merged this pull request into elrond/drop-single-table-guards Nov 17, 2026
34 checks passed
@TheSentinel454
TheSentinel454 deleted the tomb/9398-required-stop-doc branch November 17, 2026 21:30
TheSentinel454 pushed a commit that referenced this pull request Nov 17, 2026
Adds a "Single-table guards (\`0096\`)" section to
\`docs/trigger-retirement-deployment.md\` for #9398, as
\`docs/database.md\` Rule 5 requires.

Without it, the only stop the doc names is the \`0094\` one
(\`279a31da\` or later), which predates #8320. A relay that old requires
the community tombstone trigger at startup and on every readiness check,
so once \`0096\` drops it the relay goes not ready and cannot restart,
with auto-migration on or off. The new section names \`ec778bff\` (the
merge of #8320) as the required stop and rollback floor, lists the five
dropped triggers and functions with their application replacements, and
describes the locks \`0096\` takes.

### Validation

- Docs only. Checked each stated fact against the tree: \`279a31da\` is
an ancestor of \`ec778bff\`, which is an ancestor of the \`0094\` merge
(\`4e8f8365\`); \`git tag --contains ec778bf\` lists no relay release;
the error string and the unconditional startup and readiness catalog
checks at \`ec778bff^\`; the trigger and function names in \`0096\`.

### Regressions

None: one documentation file, no code or migration change.

Signed-off-by: Tom Brow <tomb@squareup.com>
Co-authored-by: Tom Brow <tomb@squareup.com>
Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@buzz.block.builderlab.xyz>
TheSentinel454 added a commit that referenced this pull request Nov 17, 2026
…#9398)

> [!NOTE]
> **Rollout:** #8320 (app guards + catalog expand) is deployed, so the
hold is lifted. With `autoMigrate=true`, `0096` runs at startup under a
5s lock timeout, and a failure stops startup. With
`BUZZ_AUTO_MIGRATE=false`, deploy this binary first and then run
`buzz-admin migrate`. Both orders are safe because the expand tolerates
the objects being present or absent.

## What

The required stop for `0096` is in
`docs/trigger-retirement-deployment.md` (from #9622): a relay build at
or after #8320 (`ec778bff`). A build older than that needs the tombstone
trigger at startup and readiness.

Migration `0096_drop_single_table_guards.sql` drops five triggers and
their functions. #8320 moved each invariant into the application
writers:

| Trigger (table) | Function |
|---|---|
| `trg_channels_community_id_immutable` (channels) |
`channels_community_id_immutable()` |
| `communities_deletion_tombstone` (communities) |
`enforce_community_tombstone()` |
| `community_deletion_request_retargeting_guard`
(community_deletion_requests) |
`prevent_community_deletion_request_retargeting()` |
| `community_deletion_approval_removal_guard`
(community_deletion_approvals) |
`prevent_community_deletion_approval_removal()` |
| `community_deletion_manifest_keys_guard`
(community_deletion_manifest_keys) |
`protect_community_deletion_manifest_keys()` |

Desired state (`schema/`) drops the five functions and four trigger
files, plus the channels trigger declaration. The universal write fence
on `channels` stays. Both boot paths stay catalog-equivalent: the
pgschema-vs-migration parity check now also compares columns, key and FK
shapes, and the remaining triggers on all five tables.

Executor GUCs stay because `assert_community_write_allowed` still reads
them through the universal write fence. `transition_community` and every
phase-1 app guard are byte-identical to #8320.
`scripts/reconcile-schema-after-pgschema.sql` has no entries for these
objects.

## Tests

- #8320's six `single_table_guard_*_without_trigger` PG tests no longer
need to disable a trigger. They are now plain app-path tests with the
same assertions.
- New per-test regressions for the desired-template and migration boot
paths assert that none of the ten objects exist, including disabled
triggers and function overloads.
- Deleted assertions that only exercised raw SQL against the triggers:
retarget, rewrite and approval mutation, frozen-manifest rewrite, and
tombstone DELETE. The app-path coverage for each remains.
- The expand regression in #8320 migrates through `0086`, validates
serving, readiness and the deletion lifecycle, drops the five guards,
then validates again.
- Rebased onto main `b568d9bf` after #8696 took `0095`; renumbered to
`0096`. Blox gate at `7bda1f45`: fmt, clippy and buzz-db `--lib` pass;
the PostgreSQL lane ran 219 tests, all pass.
- Gate at `c8bc061c` (on main `051dd2d7`, then numbered `0095`, #9622
folded in): on Blox, `cargo fmt --check`, clippy and the buzz-db `--lib`
tests pass. The PostgreSQL lane (migrations, single-table guards, floor
retirement, fence and deletion) ran 208 tests: all pass.
- Earlier gate at `0840ba49`: CI was green, and the Blox PostgreSQL lane
passed 840 of 841 (the one failure, `media_reference_full_query_plans`,
is a timing check that fails the same way on main on that host).
- The rebase updates main's fence-retirement tests to expect the
tombstone trigger gone.

## What got simpler

Ten database behavior objects and nine desired-state files are gone
(about 150 lines). Each rule has a single owner, the application writer.

buzz-review-completed

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: Luke Tornquist <tornquist@squareup.com>
Signed-off-by: Tom Brow <tomb@squareup.com>
Co-authored-by: Elrond <28d6302a099e5225b02c4155ac4236e4912603df2ab08dbfc2f4fef08ce598c8@buzz.block.builderlab.xyz>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Tom Brow <tomb@block.xyz>
Co-authored-by: Tom Brow <tomb@squareup.com>
Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@buzz.block.builderlab.xyz>
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.

2 participants