From 20030da7e0042aea3eda2c4943a0b8bf210f0cd3 Mon Sep 17 00:00:00 2001 From: Luke Tornquist Date: Tue, 17 Nov 2026 13:47:36 -0500 Subject: [PATCH 1/2] buzz-db: renumber the plain SQL function drop to 0094 #9560 and #9598 both added a migration 0093 with different file names, so GitHub showed no conflict. Main now embeds two version-93 migrations. sqlx applies the first and then rejects the second as a changed migration 93, so every migrate run fails. Keep #9560's 0093_push_gateway_installation_platform.sql, which reached main first and may already be applied, and move 0093_drop_plain_sql_functions.sql to 0094. Update the embedded-migrator asserts, the migration test name and the deployment runbook to match. Co-authored-by: Elrond <28d6302a099e5225b02c4155ac4236e4912603df2ab08dbfc2f4fef08ce598c8@buzz.block.builderlab.xyz> Co-Authored-By: Claude Opus 5.5 Signed-off-by: Luke Tornquist --- crates/buzz-db/src/runtime/migration.rs | 14 +++++++------- docs/trigger-retirement-deployment.md | 10 +++++----- ...tions.sql => 0094_drop_plain_sql_functions.sql} | 0 3 files changed, 12 insertions(+), 12 deletions(-) rename migrations/{0093_drop_plain_sql_functions.sql => 0094_drop_plain_sql_functions.sql} (100%) diff --git a/crates/buzz-db/src/runtime/migration.rs b/crates/buzz-db/src/runtime/migration.rs index ef6240b0882..ae2fab29bc2 100644 --- a/crates/buzz-db/src/runtime/migration.rs +++ b/crates/buzz-db/src/runtime/migration.rs @@ -890,7 +890,7 @@ mod postgres_tests { let mut migrations: Vec<_> = MIGRATOR.iter().collect(); migrations.sort_by_key(|migration| migration.version); - assert_eq!(migrations.len(), 93); + assert_eq!(migrations.len(), 94); assert_eq!(migrations[89].version, 90); assert!(migrations[89] .sql @@ -1034,10 +1034,10 @@ mod postgres_tests { "0091 must bound its ACCESS EXCLUSIVE lock on events before the first DROP" ); // The relay builds the deletion lock key in Rust and reads profile - // names inline, so 0093 drops both plain SQL functions. 0029 and 0064 + // names inline, so 0094 drops both plain SQL functions. 0029 and 0064 // stay frozen. - assert_eq!(migrations[92].version, 93); - let retire_functions = strip_sql_comments(migrations[92].sql.as_str()); + assert_eq!(migrations[93].version, 94); + let retire_functions = strip_sql_comments(migrations[93].sql.as_str()); for statement in [ "SET LOCAL lock_timeout = '5s';", "DROP FUNCTION community_deletion_lock_key(UUID);", @@ -1045,7 +1045,7 @@ mod postgres_tests { ] { assert!( retire_functions.contains(statement), - "0093 must run {statement}" + "0094 must run {statement}" ); } assert!(!retire_functions.contains("CASCADE")); @@ -3996,11 +3996,11 @@ mod postgres_tests { .expect("deletion catalog must accept post-retirement catalog"); } - /// 0093 drops both plain SQL functions, and the relay boots on either + /// 0094 drops both plain SQL functions, and the relay boots on either /// side of it: rolling deploys run new code before and after the drop. #[tokio::test] #[ignore = "requires Postgres"] - async fn migration_0093_drops_plain_sql_functions() { + async fn migration_0094_drops_plain_sql_functions() { let pool = connect_test_pool().await; reset_public_schema(&pool).await; let retirement = MIGRATOR diff --git a/docs/trigger-retirement-deployment.md b/docs/trigger-retirement-deployment.md index c3162f0080e..b1b09832ba1 100644 --- a/docs/trigger-retirement-deployment.md +++ b/docs/trigger-retirement-deployment.md @@ -71,9 +71,9 @@ 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. -## Plain SQL functions (`0093`) +## Plain SQL functions (`0094`) -`0093_drop_plain_sql_functions.sql` drops two functions whose work the relay +`0094_drop_plain_sql_functions.sql` drops two functions whose work the relay now does in application code: | Function | Application replacement | @@ -83,12 +83,12 @@ now does in application code: **A relay build at or after commit `279a31da` (the merge of [#9397](https://github.com/block/buzz/pull/9397), which follows #9396) and -before `0093` is a required stop.** No tagged relay release contains it: +before `0094` is a required stop.** No tagged relay release contains it: `relay-v0.3.0` does not, so a deployment on a tagged release must move to a stop build first. Follow the same procedure as above. An older relay that -still serves after `0093` fails every write and deletion that takes the community deletion lock, with +still serves after `0094` fails every write and deletion that takes the community deletion lock, with `42883 community_deletion_lock_key(uuid) does not exist`, and its profile name search fails with `42883 profile_name_fields(text) does not exist`. -`0093` takes no table locks. It needs no cleanup, and a rollback to a stop +`0094` takes no table locks. It needs no cleanup, and a rollback to a stop build needs auto-migration off, as above. diff --git a/migrations/0093_drop_plain_sql_functions.sql b/migrations/0094_drop_plain_sql_functions.sql similarity index 100% rename from migrations/0093_drop_plain_sql_functions.sql rename to migrations/0094_drop_plain_sql_functions.sql From 60acd475d0d3d36cda274c4c7a24eeb22a5f0523 Mon Sep 17 00:00:00 2001 From: Luke Tornquist Date: Tue, 17 Nov 2026 13:54:23 -0500 Subject: [PATCH 2/2] buzz-db: pass the sender in the cross-community channel update test #9581 added a `sender` argument to `update_channel`. #8320's cross-community test landed in parallel and still calls it with three arguments, so main's buzz-db lib tests no longer compile. Pass the channel creator as the sender. The test only renames an open channel, so the private-to-open rule does not apply. Co-authored-by: Elrond <28d6302a099e5225b02c4155ac4236e4912603df2ab08dbfc2f4fef08ce598c8@buzz.block.builderlab.xyz> Co-Authored-By: Claude Opus 5.5 Signed-off-by: Luke Tornquist --- crates/buzz-db/src/store/deletion.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/buzz-db/src/store/deletion.rs b/crates/buzz-db/src/store/deletion.rs index 3645edb9eba..5c4ad321057 100644 --- a/crates/buzz-db/src/store/deletion.rs +++ b/crates/buzz-db/src/store/deletion.rs @@ -5145,6 +5145,7 @@ DROP FUNCTION protect_community_deletion_manifest_keys(); name: Some("wrong-community".to_string()), ..Default::default() }, + &[1; 32], ) .await, Err(DbError::ChannelNotFound(_)) @@ -5156,6 +5157,7 @@ DROP FUNCTION protect_community_deletion_manifest_keys(); name: Some("same-community".to_string()), ..Default::default() }, + &[1; 32], ) .await .expect("same-community metadata update");