Skip to content

Fix v2 finalization rollback on duplicate tx#385

Open
raymondjacobson wants to merge 1 commit into
mainfrom
codex/fix-v2-finalize-savepoint
Open

Fix v2 finalization rollback on duplicate tx#385
raymondjacobson wants to merge 1 commit into
mainfrom
codex/fix-v2-finalize-savepoint

Conversation

@raymondjacobson

Copy link
Copy Markdown
Contributor

Summary

  • add a regression for an accepted block containing the same v2 ERN transaction twice
  • isolate v2 transaction finalization in a nested pg savepoint so a tx-level finalization error rolls back only that tx side effect work
  • preserve the existing behavior where the duplicate tx returns Code=2, but the block transaction can still commit

Test plan

  • TEST_DB_URL=postgres://localhost:55438/openaudio_test?host=/tmp/openaudio-hunt4-pg.pYbDYu go test ./pkg/core/server -run=TestFinalizeBlockDuplicateV2ERNTransactionDoesNotPoisonCommit -count=1 -v
  • TEST_DB_URL=postgres://localhost:55438/openaudio_test?host=/tmp/openaudio-hunt4-pg.pYbDYu go test ./pkg/core/server -count=1

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