fix: bind installer include mode to its migration transaction - #205
Draft
samo-agent wants to merge 2 commits into
Draft
fix: bind installer include mode to its migration transaction#205samo-agent wants to merge 2 commits into
samo-agent wants to merge 2 commits into
Conversation
Exercise a marker supplied through PGOPTIONS against both the immutable v1.5 payload and an empty database. A forced late DDL failure must leave version, config data and identity, and the ash schema exactly unchanged.
The installer previously trusted the literal internal GUC value, so an ambient PGOPTIONS setting could suppress both transaction boundaries. Store the migration's transaction ID as the local token, accept include mode only when it matches the currently assigned transaction, and cache that decision through the footer. Direct invocations now retain their transaction while the cumulative migration still owns one atomic installer-plus-normalization transaction.
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.
Draft stacked #202 fix — do not merge
This isolates the follow-up delta on the held
release/2.0branch. It does not authorize merging #200, #204, or this PR, and it does not authorize tagging. Before the final release candidate, this fix must be folded into the candidate and the release-stamp commit recreated last so payload identity remains unambiguous.Relates to #202.
Red reproduction
The previous held head
ba96f7858c0827b8afaf031cd3f832de37db256atrusted the literal value ofpg_ash.install_in_migration_transaction. Supplying it before connection startup bypassed both installer transaction boundaries:The new regression supplies
PGOPTIONS=-c pg_ash.install_in_migration_transaction=onbefore direct installer invocation. It covers both the immutable v1.5 payload and an empty database, forces a late failure atash.summary(...), and compares identity, config data, config relation OID, schema, and survival of the blocker from a fresh connection.Fix and rationale
A finite preflight cannot cover event triggers, dependency changes, concurrent DDL, vanished roles, permissions, cancellation, deadlock/timeout, storage/resource failures, or commit failure. The robust boundary remains one transaction around installer replay plus normalization.
The migration now stores its assigned transaction ID in the transaction-local internal setting. The installer accepts include mode only when that token matches
pg_current_xact_id_if_assigned(); an ambient literal such asonhas no matching assigned transaction and therefore fails closed into direct-installer transaction ownership. The installer computes that decision once and reuses it at the footer, so later SQL or an event trigger cannot change ownership by mutating the setting. The migration retains one finalCOMMIT; direct invocation retains its documented finalCOMMIT.Green verification
Exact candidate:
38af9f2f9b462027a484bd42ae0c273ecfe32a28No merge or tag has been performed.