acoustic-carpenter-78188
03/31/2026, 3:57 AMUpdateActionPhase writes updated_at/ended_at as NOW() on every call, causing B-tree right-hand page contention on those indexes under concurrent load (200ms+ lock-wait). The SQLite polling path in WatchActionUpdates also lacked a run_name filter, returning updates across all runs in a project instead of just the target run.
What changes were proposed in this pull request?
• Remove idx_actions_updated and idx_actions_ended to eliminate right-side B-tree hotspot contention on monotonically-increasing timestamp columns
• Replace four separate single-column indexes (idx_actions_org/project/domain/run_name) with one composite idx_actions_run_lookup(org, project, domain, run_name) to serve run-scoped queries with a single selective index scan
• Fix WatchActionUpdates SQLite polling query to include run_name in the WHERE clause, scoping results to the specific run
• Add migration 20260330_fix_action_indexes to drop the 6 stale indexes and trigger AutoMigrate to create the composite replacement
How was this patch tested?
• ran two psql queries to verify that the migration and the indexes were created correctly
1. Select id from migrations
• Found the id: 20260330_fix_action_indexes
2. SELECT indexname FROM pg_indexes WHERE tablename = 'actions' ORDER BY indexname;
• idx_actions_run_lookup is present (new composite index)
• idx_actions_updated, idx_actions_ended, idx_actions_org, idx_actions_project, idx_actions_domain, idx_actions_run_name are all gone
3. ran hello.py from the sdk on the sandbox as a smoke test
Setup process
Screenshots
Check all the applicable boxes
• I updated the documentation accordingly.
• All new and existing tests passed.
• All commits are signed-off.
Related PRs
Docs link
• main
• #6583
• fix(runs): fix B-tree index contention on actions table 👈
flyteorg/flyteacoustic-carpenter-78188
03/31/2026, 5:31 PM