mirror of
https://github.com/block/buzz.git
synced 2026-11-24 10:12:19 +00:00
docs: name the required stop as a relay build, not a release (#9577)
## Summary `docs/trigger-retirement-deployment.md` (added in #8326) named "the first relay release that contains #8325" as the required stop before migrations 0089–0091. Relay deployments run images built from main, and no tagged relay release contains #8325. So the doc now names any relay build at or after `68785206` (the merge of #8325) as the stop. It also tells deployments on a tagged release, such as `relay-v0.3.0`, to move to a stop build first. This is the follow-up promised in the #8326 review thread. ## Changes - `docs/trigger-retirement-deployment.md`: "stop release" becomes "stop build" throughout. The required-stop section names the commit. The `0089_retire_created_at_floor.sql` comment still says "release". That migration has merged, and editing it would change its sqlx checksum, so it stays as is. ## What got simpler The procedure no longer depends on a release being cut. Operators follow the image they already deploy. ## Testing Docs-only. No code or migration changes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Signed-off-by: Luke Tornquist <tornquist@squareup.com> Co-authored-by: Elrond <28d6302a099e5225b02c4155ac4236e4912603df2ab08dbfc2f4fef08ce598c8@buzz.block.builderlab.xyz> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# Trigger retirement deployment
|
||||
|
||||
Three migrations drop database triggers and functions whose work the relay
|
||||
now does in application code. They ship in one release:
|
||||
now does in application code. They ship together:
|
||||
|
||||
| Migration | Drops | Application replacement |
|
||||
| --- | --- | --- |
|
||||
@@ -11,16 +11,17 @@ now does in application code. They ship in one release:
|
||||
|
||||
## Required stop
|
||||
|
||||
**The first relay release that contains
|
||||
[#8325](https://github.com/block/buzz/pull/8325) is a required stop.** It also
|
||||
contains every other replacement above. `relay-v0.3.0` has the others but not
|
||||
#8325, so it is not enough.
|
||||
**A relay build at or after commit `68785206` (the merge of
|
||||
[#8325](https://github.com/block/buzz/pull/8325)) and before these migrations
|
||||
is a required stop.** Such a build contains every replacement above. No tagged
|
||||
relay release contains #8325: `relay-v0.3.0` has the others but not #8325, so
|
||||
a deployment on a tagged release must move to a stop build first.
|
||||
|
||||
Do not upgrade past the stop to the release with these migrations until no
|
||||
older relay runs anywhere: every pod and job, not only a rollout's new pods.
|
||||
The migrations cannot detect an older writer. If an operator upgrades straight
|
||||
from an older release, the first new pod applies the migrations while older
|
||||
pods are still serving:
|
||||
Do not upgrade past the stop build to one with these migrations until no older
|
||||
relay runs anywhere: every pod and job, not only a rollout's new pods. The
|
||||
migrations cannot detect an older writer. If an operator upgrades straight
|
||||
from an older build, the first new pod applies the migrations while older pods
|
||||
are still serving:
|
||||
|
||||
- a relay without #8325 has no floor check, so it accepts backdated channel
|
||||
events that replica reads can then skip;
|
||||
@@ -30,7 +31,7 @@ pods are still serving:
|
||||
|
||||
## Procedure
|
||||
|
||||
1. Deploy the stop release. Check the image of every relay pod and job, and
|
||||
1. Deploy a stop build. Check the image of every relay pod and job, and
|
||||
wait until none runs an older one.
|
||||
2. Stop out-of-band writers (direct SQL, `COPY`, restores, seed scripts). Hold
|
||||
the replica breaker closed from before the migrations until every replica
|
||||
@@ -39,16 +40,16 @@ pods are still serving:
|
||||
`DROP TRIGGER` statements take `ACCESS EXCLUSIVE` on `events` and its
|
||||
partitions, so event reads and writes can stall for up to that long. A
|
||||
lock timeout aborts that migration, which is safe to retry.
|
||||
- **Auto-migration on:** deploy the new release. Its first pod applies the
|
||||
- **Auto-migration on:** deploy the new build. Its first pod applies the
|
||||
migrations at startup.
|
||||
- **Auto-migration off:** run `buzz-admin migrate` with the target
|
||||
`DATABASE_URL`, confirm that it records 0089, 0090 and 0091, then deploy
|
||||
the new release. The new release assumes 0091 has run: against a
|
||||
the new build. The new build assumes 0091 has run: against a
|
||||
database without it, NIP-RS hard deletes fail closed with
|
||||
`check_violation`. The stop release works with all three applied.
|
||||
4. Once every relay runs the new release, run the one-off cleanup SQL in
|
||||
`check_violation`. The stop build works with all three applied.
|
||||
4. Once every relay runs the new build, run the one-off cleanup SQL in
|
||||
[#8211](https://github.com/block/buzz/pull/8211) once per database. While
|
||||
stop-release pods served after 0091, a replacement could leave a
|
||||
stop-build pods served after 0091, a replacement could leave a
|
||||
soft-deleted NIP-RS or mesh-status head that nothing purges any more. The
|
||||
cleanup is idempotent.
|
||||
|
||||
@@ -63,9 +64,9 @@ PostgreSQL refuses with `2BP01`.
|
||||
|
||||
## Rollback
|
||||
|
||||
Roll back to the stop release, not further, and only with auto-migration off
|
||||
Roll back to the stop build, not further, and only with auto-migration off
|
||||
(`BUZZ_AUTO_MIGRATE=false`, or `migrate.autoMigrate=false` in the Helm chart).
|
||||
With it on, the stop release refuses a database that has migrations it does
|
||||
not know (`VersionMissing`) and does not start. With it off, the stop release
|
||||
With it on, the stop build refuses a database that has migrations it does
|
||||
not know (`VersionMissing`) and does not start. With it off, the stop build
|
||||
serves, but its startup check finds the floor trigger gone and keeps the
|
||||
replica fence closed, so cursor reads go to the writer.
|
||||
|
||||
Reference in New Issue
Block a user