Skip to content

chore(api): bump etl to include slug-collision route index (#337)#912

Open
raymondjacobson wants to merge 1 commit into
mainfrom
chore/bump-etl-slug-collision
Open

chore(api): bump etl to include slug-collision route index (#337)#912
raymondjacobson wants to merge 1 commit into
mainfrom
chore/bump-etl-slug-collision

Conversation

@raymondjacobson
Copy link
Copy Markdown
Member

Summary

Bumps github.com/OpenAudio/go-openaudio and .../pkg/etl from 5d2e19a (#901) to 43606e8 to consume go-openaudio #337.

That change adds ETL migration 0031, which indexes track_routes and playlist_routes on (owner_id, title_slug, collision_id). Slug-collision resolution runs SELECT MAX(collision_id) … WHERE owner_id AND title_slug on every track/playlist create + rename; today that's a full per-owner route scan (prod EXPLAIN: ~16k-row bitmap heap scan on every upload for a prolific owner), which is the multi-second Track (7.8s) / Playlist (44s) tail in core-indexer. The new index makes it an index-only lookup.

core-indexer runs this vendored audius/api image, so this bump is required to ship #337 to prod.

Changes

  • go.mod / go.sum: both go-openaudio modules → v1.3.1-0.20260604005215-43606e8d8e5a

⚠️ Deploy note — pre-build the indexes CONCURRENTLY first

Migration 0031 builds the indexes non-concurrently (single-transaction migration runner), taking an ACCESS EXCLUSIVE lock on track_routes (~2M rows / 493 MB) on indexer boot. To avoid stalling route writes on deploy, pre-build them in prod first — IF NOT EXISTS then makes the migration a no-op (same pattern used to recover the 0030 indexes):

CREATE INDEX CONCURRENTLY IF NOT EXISTS track_routes_owner_title_slug_idx
  ON track_routes (owner_id, title_slug, collision_id);
CREATE INDEX CONCURRENTLY IF NOT EXISTS playlist_routes_owner_title_slug_idx
  ON playlist_routes (owner_id, title_slug, collision_id);

Test plan

  • go mod tidy — only go.mod/go.sum changed
  • go build ./... passes
  • migration 0031 present in the resolved module
  • Post-deploy: 0031 applied (or no-op if pre-built), and Track/Playlist max processing times drop in the indexer log analysis

🤖 Generated with Claude Code

Pulls go-openaudio 43606e8, which adds migration 0031 indexing
track_routes/playlist_routes on (owner_id, title_slug, collision_id).
This makes the per-upload slug-collision MAX(collision_id) lookup an
index-only scan instead of a full per-owner route scan, cutting the
multi-second Track/Playlist tail in core-indexer.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant