Files
fusion/packages
gsxdsm f4e78abeb7 fix: resolve CREATE ROLE fusion_runtime race condition in migration 0006 (#2104)
## Summary

Fixes `CREATE ROLE fusion_runtime` race condition in migration
`0006_project_ownership.sql` that causes 30 compound-engineering test
failures on CI.

## Root Cause

Concurrent test databases on the same PostgreSQL service container race
on `CREATE ROLE fusion_runtime`: the `IF NOT EXISTS` check is not atomic
(roles are cluster-wide, not per-database). Between the check and the
`CREATE ROLE`, another session can create the role, causing error
`23505` (unique_violation).

## Fix

Replace the non-atomic `IF NOT EXISTS` guard with a `BEGIN...EXCEPTION
WHEN duplicate_object OR unique_violation THEN NULL; END;` block that
safely handles the race.

## Verification

| Check | Result |
|---|---|
| compound-engineering (pipeline-store + orchestrator + session-routes)
| ✅ 41 passed |
| Engine shard 1/2 | ✅ 3826 passed, 0 failed |
| Merge gate | ✅ 471 passed |
| Lint | ✅ exit 0 |
2026-07-14 20:48:30 -07:00
..
2026-07-13 10:32:12 -07:00
2026-07-13 10:32:12 -07:00
2026-07-13 10:32:12 -07:00
2026-07-13 10:32:12 -07:00
2026-07-13 10:32:12 -07:00