Repository navigation
Closed
Labels
Description
Context
Follow-up to #426, which adds the first two-phase extension schema-upgrade e2e spec (test/e2e/tests/upgrade/upgrade_schema_test.go). In review, @xgerman noted the PR intentionally covers only the happy-path single old→new hop and asked to file tickets for the explicit gaps. This issue tracks that future work.
Not covered by #426 (explicit gaps)
-
spec.schemaVersion: "auto"single-step path — documented behavior but currently untested. Verify thatautomigrates the schema in a single step (no separate finalize) and retains data. (test(e2e): schema-upgrade coverage — auto, rollback, HA, unpullable version #443) - Rollback within the safe window — binary downgrade before finalize. In two-phase mode the schema stays at the old version, so a
spec.documentDBVersiondowngrade before settingschemaVersionshould be safe; assert data + schema integrity across the down-hop. (test(e2e): schema-upgrade coverage — auto, rollback, HA, unpullable version #443) - Multi-instance / HA rollout ordering — the current spec pins
INSTANCES=1. Cover a multi-replica cluster and assert rollout ordering and data availability during the schema upgrade. Verifies replica schema convergence directly viapg_extension.extversion. (test(e2e): schema-upgrade coverage — auto, rollback, HA, unpullable version #443) - Negative / failure paths:
- Invalid / unpullable
documentDBVersion— schema does not advance, data stays readable, cluster recovers after rollback. (test(e2e): schema-upgrade coverage — auto, rollback, HA, unpullable version #443) - Migration failure (e.g.
ALTER EXTENSION UPDATEfails) — operator surfaces the error, does not corrupt data. (deferred → feat: fail-fast preflight for extension update paths (+ e2e for >1-minor jumps and migration failure) #448; realistically triggered by a broken update-path, so it needs the preflight to be reachable deterministically) - Skipping more than one minor (jump >1 version) — expected handling. (deferred → feat: fail-fast preflight for extension update paths (+ e2e for >1-minor jumps and migration failure) #448; depends on the fail-fast update-path preflight)
- Invalid / unpullable
- Multi-version chain — the current spec does a single old→new hop. Cover a chained upgrade across more than two versions. (deferred → feat: fail-fast preflight for extension update paths (+ e2e for >1-minor jumps and migration failure) #448)
Acceptance
Each gap above is either covered by an e2e spec (with appropriate labels/level) or explicitly deferred with a documented rationale. ✅ Met — see the closing comment.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
WentingWu666666 commentedon Aug 13, 2026
First two gaps addressed in #443 (draft):
spec.schemaVersion: "auto"single-step pathRemaining: negative/failure paths, multi-instance/HA rollout ordering, and multi-version chain.
WentingWu666666 commentedon Aug 13, 2026
Design proposal: fail-fast preflight for schema-upgrade path (re: ">1 minor jump")
Splitting the "skip >1 minor" sub-item out for a design decision, because today the operator has no update-path validation anywhere — it runs a blanket
ALTER EXTENSION documentdb UPDATEand relies entirely on PostgreSQL to resolve the path.Context: cadence forces us to support jumps
The
documentdbextension ships minors frequently (about monthly, at times bi-weekly). A user who upgrades quarterly is already 3+ minors behind; twice-a-year is 6+. Forcing adjacent-only (N to N+1) upgrades would mean 3–12 sequential rolling restarts to catch up, which pushes users to never upgrade. Conclusion: multi-minor jumps should be a first-class, supported path — not rejected.The risk to manage
A jump only works if the extension ships a continuous chain of
documentdb--A--B.sqlupdate scripts. If any release forgets to publish its script,ALTER EXTENSION UPDATEfails at execution time with a raw PG error ("extension has no update path from X to Y"), re-fires every reconcile, and the user gets a cryptic failure with no actionable status.Proposal: preflight the path before migrating
PostgreSQL exposes the update-path graph read-only:
path IS NULL-> fail-fast signal.Hook this into
documentdb_controller.goimmediately before theSQLExecutor(... updateSQL)call: if no path exists, skipALTER EXTENSION, emit aWarningevent + aSchemaUpgradeBlocked(reasonNoUpdatePath) status condition naming the exact gap, and return cleanly (stable, no crash-loop).status.conditionson the CRCheap static parts could also move to the validating webhook, but the path check needs DB connectivity, so the controller (which already has a SQL executor + cluster handle) is the pragmatic home.
Proposed sequencing
Decision needed from maintainers
test(e2e): add HA schema-upgrade and unpullable-version specs
test(e2e): add schema-upgrade auto-mode and safe-window rollback specs
test(e2e): add HA schema-upgrade and unpullable-version specs
feat: fail-fast preflight for schema upgrade path
WentingWu666666 commentedon Aug 24, 2026
Closing — the acceptance criterion here ("each gap is either covered by an e2e spec or explicitly deferred with a documented rationale") is now met.
Covered by #443 (merged):
spec.schemaVersion: "auto"single-step pathpg_extension.extversiondocumentDBVersionDeferred to #448, with rationale: the three remaining gaps — migration failure, >1-minor jumps, and the multi-version chain — all hinge on the same unmade decision. The operator currently does no update-path validation at all: it fires a blanket
ALTER EXTENSION documentdb UPDATEand lets PostgreSQL resolve the path. Writing e2e specs against that today would just pin in whatever behavior falls out, and the migration-failure case isn't even deterministically reachable without a broken update path to trigger it. #448 carries the design decision (fail-fastpg_extension_update_pathspreflight +SchemaUpgradeBlockedcondition), the implementation, and these three tests together, so the tests assert a ratified contract rather than an accident.#448 needs a maintainer call on three points before implementation starts — whether multi-minor jumps are supported (they should be, given the roughly monthly extension cadence), the fail-fast contract, and controller-vs-webhook placement. @xgerman @alaye-ms, that's the decision to weigh in on.
feat: fail-fast preflight for extension update paths