Repository navigation
DO NOT MERGE without coordinator GO: 3.1 pre-migrate: rc.6 serves while 3.1's migrate applies 027, 028 and 031, and p0 is never rewritten - #773
Conversation
|
Found 1 test failure on Blacksmith runners: Failure
|
e479006 to
327e596
Compare
…028 and 031, and p0 is never rewritten The 3.0 -> 3.1 cutover can run 3.1's migrate against A's database before its window, while the 3.0 pair serves on 3.0.0-rc.7. Two gated dual-sim tests hold that to what the cutover relies on, in the fast lane and the nightly matrix: - R1: the 3.0 pair on rc.7 under load (database made by rc.7's migrate, every start with PRISM_POSTGRES_INIT_SCHEMA=0). 3.1's migrate runs once with A's frontend environment while a reader holds a snapshot, so 031's CREATE INDEX CONCURRENTLY is caught part-way. 027 and 028 commit with no share refused and none waiting the 5 s lock timeout, appends continue, a block lands, A restarts and serves with 31 unrecorded and the index invalid, then 31 is recorded, the index is valid on the writer and the standby, B restarts at 31, a last block lands, and the checker's invariants hold. - p0: on a populated ledger with an appender under the frontends' lock timeout, p0 and its TOAST table keep relfilenode, relfrozenxid and relminmxid and their vacuum and analyze counters, the statement log holds no VACUUM, ANALYZE, CLUSTER or REINDEX, and p0's only index build is CREATE INDEX CONCURRENTLY (qbit-tools #1345). A by-hand measurement runs the second at millions of rows. The gate gains PRISM_TEST_RC7_SERVER_BIN, and the prism-rc7-server action builds the pinned rc.7 commit (#772's head b7b6923) once per pin. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… restarts From a local review of #773: - An index build on p0 is any CREATE INDEX on it, named or not, or on the ledger without ONLY (which recurses into every partition); the scratch apply's statements, under the migrator's rolled-back savepoint, are left out, and maintenance commands are counted everywhere. - p0's TOAST table's vacuum and analyze counters are compared too (pg_stat_all_tables), and log timestamps are compared by date and time, so a run across midnight measures right. - The seed is refused unless every row stays in p0. - R1's restarts wait for the balancer to mark the node down before starting it, require a graceful stop, and count shares from when the balancer had the node up again; the one-off migrate and the appender are aborted, and the migrate killed, when a step fails first. Co-Authored-By: Claude Opus 5.5 <[email protected]>
rc.7 was skipped: the pair serves v3.0.0-rc.6 (81c592c) until the 3.1 repin, so the pre-migrate runs beside rc.6 frontends, and R1 and the p0 test run rc.6 (PRISM_TEST_RC6_SERVER_BIN, the prism-rc6-server action at the v3.0.0-rc.6 commit). rc.6's start gate, require_schema_version, its NATIVE_CAPABILITIES and its connect-time capability checks are identical to rc.7's (4c13491), as are the migration files. Co-Authored-By: Claude Opus 5.5 <[email protected]>
38e8f83 to
1efe2f0
Compare
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
CI note on 1efe2f0: one unrelated failure, needs Shard 3 failed in
|
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* 3.x.x: version 3.1.0-rc.1 VERSION, the workspace version and both lockfiles move to 3.1.0-rc.1. The fuzz lockfile also picks up hyper and hyper-util, which #769 added to the server without refreshing it. The 3.0.0 and development-line notes point at the new candidate; its own notes follow in this pull request. Co-Authored-By: Claude Opus 5.5 <[email protected]> * 3.x.x: 3.1.0-rc.1 release notes The notes cover everything since v3.0.0-rc.6: #770's import-audits fix (#765) and #760's idle-connection bound (#759), which would have shipped as rc.7, and the 3.1 dual writer (#766, #768, #767, #769, #763), off by default. They describe the new settings, migrations 027, 028 and 031 (029 and 030 reserved), the upgrade from rc.6 with the migrate run while rc.6 serves, the rollbacks, and the dual writer's known limits. The migration guide's import-audits paragraph names this candidate in place of the skipped rc.7. Co-Authored-By: Claude Opus 5.5 <[email protected]> * 3.x.x: 3.1.0-rc.1 notes: #773's pre-migrate tests Co-Authored-By: Claude Opus 5.5 <[email protected]> * 3.x.x: 3.1.0-rc.1 notes: the rollback to one writer stops and syncs the peer first Codex on #774: DOWNGRADE fences nothing, so the peer must be stopped, and its tail pulled, before the single-writer start; declare the tail lost only for a peer that never returns with its own database. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
* 3.x.x: version 3.1.0, and tokio 1.53.3 for RUSTSEC-2026-0386 VERSION, the workspace version and both lockfiles' workspace members move to 3.1.0. tokio moves from 1.53.1 to 1.53.3, its first fixed patch release for RUSTSEC-2026-0386, in the root and fuzz lockfiles, as main took it in #781. cargo update -p tokio --precise 1.53.3 also moved the windows-sys edges of four unrelated crates to 0.52.0, so, as in #781, only tokio's version and checksum change. Nothing in the workspace uses AsyncFd. Co-Authored-By: Claude Opus 5.5 <[email protected]> * 3.x.x: 3.1.0 release notes, and 3.x.x as the production line doc/release-notes-3.1.0.md covers the changes since 3.1.0-rc.1 (#777's TLS updates and the tokio update), the upgrade from rc.1 (a binary swap) and from 3.0.0 or 3.0.0-rc.6 (#773's pre-migrate, the binary, then the optional dual-writer cutover), and the known issues carried from rc.1 plus #779's L3 failures and the acknowledgement bound's connection drop that main fixes in #781. The README banner, the development-line note and the migration guide now say 3.x.x is the production line, deployed from the v3.1.0 tag. Co-Authored-By: Claude Opus 5.5 <[email protected]> * 3.x.x: 3.1.0 notes: review fixes The migration guide and ledger operations cite the released 3.0.0 notes' D5 boundary at v3.0.0, not this branch's pre-release copy. The development-line note's header no longer calls the line "not a release". The 3.1.0 notes say a dual-writer-off frontend serves as 3.0's does once the migrations are applied, tell a 2.0.x upgrade that #765's guard is not needed, and list the required prism-dual-writer lane and rc.1's evidence set under Verification. Co-Authored-By: Claude Opus 5.5 <[email protected]> * 3.x.x: 3.1.0 notes: second review round The #779 known issue counts the async preset's failed repeats (four of six) and names the sync preset rather than a repeat's job. The cutover step names node-identity repersonalise and defers the cutover itself to the pair's runbook, as rc.1's notes do. Verification says docs changed since rc.1 too. The development-line note says 3.0.x is not an ancestor of 3.1.0, and the migration guide no longer implies the 3.0.0 candidates were a supported production upgrade. Co-Authored-By: Claude Opus 5.5 <[email protected]> * 3.x.x: 3.1.0 notes: rewrap two lines Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
Base
3.x.x(the 3.1 stack, #763 squash-merged as f11b817). Tests and CI only: no product code changes.Why
The 3.0 → 3.1 cutover can apply 3.1's migrations to A's database before its window, while the 3.0 pair keeps serving on 3.0.0-rc.6. The window's migrate step then becomes a read-back, and 031's index build (long on a large ledger) moves out of the outage. This PR proves rc.6 frontends accept a database 3.1's
migratetakes to 27, 28 and 31, and keep serving throughout. It also proves the online 031 build never rewrites, freezes, vacuums or analyzes the ledger's data partition, p0 (qbit-tools #1345).Why rc.6 accepts it. The pair serves v3.0.0-rc.6 (
81c592c3) until the 3.1 repin (rc.7 was skipped). rc.6's start gate isrequire_schema_versionincrates/qbit-prism-server/src/ledger/migration.rsat81c592c3. It refuses only a database missing one of the migrations it requires (2 to 26), and logs any migration it doesn't know: "database has schema migrations this server does not know; a later release applied them". 027, 028 and 031 declare no capability, so rc.6's connect-time capability gate (require_known_capabilities) passes too. Production lanes renderPRISM_POSTGRES_INIT_SCHEMA=0, so an rc.6 frontend never migrates.What runs
Both tests are new ids in the dual-writer fast lane and the nightly matrix, and are named in
test/e2e-scenarios.toml.R1 (
r01_rc6_pair_serves_lands_and_restarts_while_3_1_migrates_its_database_to_31)The 3.0 pair (A the writer, B its streaming standby, both frontends writing A's database) runs on rc.6 under load. rc.6's own
migratemade the database, and every start runs withPRISM_POSTGRES_INIT_SCHEMA=0.migrateruns once, as a one-off command with A's frontend environment (its writer role and DSN). A reader holds a snapshot from before it, as any long read on the primary can, so 031's firstCREATE INDEX CONCURRENTLYwaits part-way.migratereports…, 26, 27, 28, 31 ready.sync_seqfromqbit_prism_next_sync_seq(), which rc.6's role may call).p0 (
r01_the_premigrate_never_rewrites_freezes_vacuums_or_analyzes_the_ledgers_data_partition,src/premigrate.rs)This test runs no frontend. It uses one PostgreSQL 16 cluster with
log_min_duration_statement = 0and autovacuum off, so any change is the migrate's.lock_timeout = 5swhile 3.1'smigrateruns.Checked:
CREATE INDEX CONCURRENTLY.The test also reports, from the statement log:
ON ONLYand each attach;A by-hand variant (
r01_measure_the_premigrate_on_a_ledger_of_millions_of_rows, no lane) runs the same at scale. It is configured byPRISM_PREMIGRATE_ROWS,PRISM_PREMIGRATE_MWMandPRISM_PREMIGRATE_WORKERS.Not covered: what PostgreSQL itself does. CIC and autovacuum both take SHARE UPDATE EXCLUSIVE on p0. A build waits for a vacuum already running there (an anti-wraparound one is not cancelled for it), and no autovacuum of p0 starts during the build. Each CIC phase also holds a snapshot, which holds back dead-row cleanup database-wide for the build.
Local results (this host)
Wiring
qbit-prism-test-gategainsPRISM_TEST_RC6_SERVER_BIN(Input::Rc6ServerBin), andcheck_gate_env_reads.pygains the name..github/actions/prism-rc6-serveraction buildsqbit-prism-serverfrom the v3.0.0-rc.6 commit (81c592c3), checks--version, caches it per commit, and exports the path. Both the fast lane and the nightly job use it.SimConfig::frontend_release(ThisorRc6) andInputs::rc6_server.Review notes
/code-review mediumraised P2s, and I fixed most of them in 0a01c6f:outcome.json, not a matrixreport.json, but its gate-manifest line still proves it ran;81c592c3and4c134913,require_schema_version,NATIVE_CAPABILITIES,require_known_capabilities,refuse_unknown_capabilities,require_declared_capabilitiesand the migration SQL are identical. Themigration.rsdiff between them is 3.x.x: import-audits holds SETTLEMENT_LOCK while writing a large canonical audit body (≥90 s for ~112 MB), stalling template refresh and settlement #765's import code inimpl Ledger.🤖 Generated with Claude Code