CSN ordinary path prototype - #1
Draft
vbp1 wants to merge 28 commits into
Draft
Conversation
Complete follow-up correctness work for the lock-free ordinary primary transaction-end path. Adapt the CSN-specific validation surface, document isolated test debt, and keep the broad local check-world gate green with extended PG_TEST_EXTRA coverage.
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.
Purpose
This PR publishes the current CSN prototype branch for review against an up-to-date
vbp1/postgres:master.The work explores replacing PostgreSQL's ordinary primary MVCC hot path with commit-sequence-number based visibility. The immediate operational goal is to reduce contention around ordinary transaction finish and prepare the next step where supported primary snapshot acquisition no longer scans
ProcArray.In user-visible terms, the intended direction is:
What Is Implemented In This Branch
This branch contains the CSN prototype through Stage 3 H1 Milestone A.
Major changes:
pg_csnlogstorage for xid-to-CSN state.snapshot_csnto MVCC snapshots.TransactionIdIsInProgress()prefer CSN status for the supported primary path.ProcArrayLock.COMMIT/ABORTfrom the regularProcArrayEndTransaction()/ProcArrayGroupClearXid()path.ProcArrayLockacquisition witnesses..agentsplanning notes.Milestone A Result
Milestone A is locally complete on this branch.
For supported ordinary primary transactions:
COMMIT/ABORTno longer acquireProcArrayLockon the supported path;ProcArraymirrors as non-authoritative;This does not mean
ProcArrayis gone. After Milestone A it is still present as a compatibility and legacy surface. The branch only removes the ordinary transaction-end hot path dependency that was targeted by Milestone A.Known Limitations
Current limitations are intentional for this prototype stage:
GetSnapshotData()still scansProcArrayfor supported CSN snapshots today.xip/subxipcompatibility payload.SERIALIZABLE, hot standby, recovery snapshots, and logical decoding are not fully supported CSN targets yet.pg_dumpis skipped under CSN snapshots because synchronized snapshot export is intentionally unsupported at this stage.pg_xact_status()retention for old committed prepared xids is unresolved: after truncation pressure, an old prepared xid may become unavailable even though data visibility remains correct.Validation
The following broad local gate was previously green on this branch:
SKIP_READLINE_TESTS=1 \ PG_TEST_EXTRA='kerberos ldap ssl load_balance libpq_encryption oauth wal_consistency_checking regress_dump_restore saslprep checksum_extended xid_wraparound' \ make -C /home/vbponomarev/postgres check-worldThe pass included core regress, isolation, recovery, subscription, contrib,
src/bin, checksum extended, xid wraparound, and the adaptedpg_upgraderegress dump/restore path.Validation was not rerun during the PR publishing step.
Validation Debt
The following test coverage is deliberately disabled or weakened and must be revisited before treating the prototype as production-ready:
src/test/modules/test_plan_adviceis disabled as wrapper-level validation debt.src/test/recovery/t/031_recovery_conflict.plis skipped under CSN snapshots.src/test/recovery/t/035_standby_logical_decoding.plis skipped under CSN snapshots.src/test/recovery/t/044_invalidate_inactive_slots.plis skipped under CSN snapshots.src/bin/pg_dump/t/004_pg_dump_parallel.plis skipped under CSN snapshots.src/test/recovery/t/053_csnlog_truncate.plis weakened to allowpg_xact_status(prepared_xid)to become unavailable after truncation pressure.src/bin/psql/t/010_tab_completion.plwas skipped in the broad local gate throughSKIP_READLINE_TESTS=1because the local PTY/readline TAP is unstable in this environment.What Comes Next
Planned Milestone B:
ProcArrayLockandProcArrayscanning from supported primary CSN snapshot acquisition;xip/subxippayload for supported CSN snapshots;ProcArrayscan for snapshotxmin/ retention with a conservative published horizon contract;Planned Milestone C:
ProcArray;ProcArrayauthoritative only for explicit legacy surfaces such as 2PC, recovery, standby, logical decoding, and unsupported snapshot shapes;Current PR State
The fork
masterwas fast-forwarded to upstreampostgres/postgres:masterbefore opening this PR.GitHub currently reports this PR as conflicting. That is expected to be inspected as part of this publication step: the branch has a substantial prototype delta and upstream has moved forward significantly.