fix(database): guard inbound migrations against active PostgreSQL writes

Acquire non-blocking database locks before inbound migration. Keep migration passes atomic and return errors to the CLI and import callers.
This commit is contained in:
Hamed Sanaei
2026-12-01 01:44:44 +03:30
parent 267379456a
commit 6cc963cf52
5 changed files with 237 additions and 46 deletions
+10
View File
@@ -194,6 +194,16 @@ jobs:
exit 1
fi
- name: PostgreSQL inbound migration contention
run: |
set -o pipefail
go test ./internal/web/service -run '^TestMigrationRequirementsRejectsLiveNodeMergePostgres$' -count=1 -v | tee /tmp/postgres-inbound-migration.log
passed=$(grep -c -- '^--- PASS' /tmp/postgres-inbound-migration.log || true)
if [ "$passed" -ne 1 ]; then
echo "expected the PostgreSQL inbound migration contention test to pass, got $passed" >&2
exit 1
fi
- name: PostgreSQL node snapshot regressions
run: |
set -o pipefail