test(etl): same-block route collision regression test (parity 2C)#244
Open
raymondjacobson wants to merge 1 commit intoetl/parity-2b-price-historyfrom
Open
test(etl): same-block route collision regression test (parity 2C)#244raymondjacobson wants to merge 1 commit intoetl/parity-2b-price-historyfrom
raymondjacobson wants to merge 1 commit intoetl/parity-2b-price-historyfrom
Conversation
Stack 2C audit. The original parity report flagged "in-block pending_routes collision tracking" as missing because apps explicitly threads a pending_track_routes / pending_playlist_routes list through block processing — necessary because apps' Python pipeline defers INSERTs to the end of the block (records are staged in new_records and bulk-inserted on commit). go-openaudio doesn't need that mechanism: handlers in indexer.go use e.pool directly with no surrounding transaction, so each Exec auto-commits before the next handler runs. Tx N+1's slug query already sees tx N's inserted route_routes / playlist_routes row, and GenerateSlugAndCollisionID correctly assigns collision_id=1 etc. This commit adds two regression tests to lock that behavior in. If a future refactor groups same-block INSERTs into a single transaction (e.g. for performance), it must also add an explicit pending_routes mechanism or the same-title same-block case will silently produce duplicate slugs. No code change; documentation + test only. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stack 2C audit / regression test. The original parity report flagged "in-block `pending_routes` collision tracking" as missing because apps explicitly threads `pending_track_routes` / `pending_playlist_routes` lists through block processing.
Investigation: that mechanism isn't needed in go-openaudio's current architecture. Handlers in `indexer.go` use `e.pool` directly with no surrounding transaction, so each `Exec` auto-commits before the next handler runs. Tx N+1's slug query already sees tx N's inserted `track_routes` / `playlist_routes` row, and `GenerateSlugAndCollisionID` correctly assigns `collision_id=1`.
apps needs the explicit pending list because its Python pipeline defers INSERTs to end-of-block (records staged in `new_records`, bulk-inserted on commit).
What this PR adds
Two regression tests that lock the current behavior in. If a future refactor groups same-block INSERTs into a single transaction (e.g. for write throughput), it must also introduce a pending_routes mechanism — otherwise same-title same-block tracks/playlists will silently get duplicate slugs.
No code change; tests + commit-message documentation only.
Stack context
Stacked on #243 (2B — price history).
Test plan
🤖 Generated with Claude Code