Repository navigation
buzz-db: drop the five single-table guard triggers (BUZZ-318 phase 2) - #9398
Draft
TheSentinel454 wants to merge 1 commit into
Draft
TheSentinel454 wants to merge 1 commit into
TheSentinel454 wants to merge 1 commit into
Conversation
Migration 0090 drops trg_channels_community_id_immutable, communities_deletion_tombstone, community_deletion_request_retargeting_guard, community_deletion_approval_removal_guard and community_deletion_manifest_keys_guard with their functions. Application writers own each rule since phase 1, and catalog checks tolerate their absence since the expand commit below. Remove them from desired state, keep catalog parity between both boot paths, convert the six trigger-disabled app regressions into plain app tests, and delete assertions that only exercised the triggers. Co-authored-by: Elrond <28d6302a099e5225b02c4155ac4236e4912603df2ab08dbfc2f4fef08ce598c8@buzz.block.builderlab.xyz> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Luke Tornquist <tornquist@squareup.com>
TheSentinel454
force-pushed
the
elrond/single-table-guards-app
branch
from
November 12, 2026 15:55
cdc88ed to
ac0fab9
Compare
TheSentinel454
force-pushed
the
elrond/drop-single-table-guards
branch
from
November 12, 2026 15:55
726659b to
1c2a638
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Important
Hold: do not merge until #8320 is deployed in every environment. #8320 now carries both the application guards and the catalog expand (
cdc88edd). Before the expand,validate_serving_catalog(boot atmain.rs, and readiness) required the enabledcommunities_deletion_tombstonetrigger, so a pod without it fails boot and readiness once0090has run.Rollout order: deploy #8320 fleet-wide with no rollback expected below it, then merge this. With
autoMigrate=true,0090runs at startup under a 5s lock timeout and a failure stops startup. WithBUZZ_AUTO_MIGRATE=false, deploy this binary first and then runbuzz-admin migrate. Both orders are safe because the expand already tolerates the objects being present or absent.What
Migration
0090_drop_single_table_guards.sqldrops five triggers and their functions. #8320 moved each invariant into the application writers: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 onchannelsstays. 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_allowedstill reads them through the universal write fence.transition_communityand every phase-1 app guard are byte-identical to #8320.scripts/reconcile-schema-after-pgschema.sqlhas no entries for these objects.Tests
single_table_guard_*_without_triggerPG tests no longer need to disable a trigger. They are now plain app-path tests with the same assertions.0086, validates serving, readiness and the deletion lifecycle, drops the five guards, then validates again.cargo fmt --checkandcargo clippy --workspace --all-targets -D warningsare clean,buzz-db --lib212/212 andobservability_source38/38 pass, and the PostgreSQL packages pass: buzz-db 750, relay 641, admin 10, audit 7, deletion 40, push-gateway 12, search 29 and workflow 6. Three buzz-db tests hang on this host; I reproduced the same hangs on the clean phase-1 base and excluded only those from the local run.What got simpler
Ten database behavior objects and nine desired-state files are gone (about 150 lines). Runtime catalog validation is now one lock-function lookup instead of a trigger join. Each rule has a single owner, the application writer.
🤖 Generated with Claude Code