Repository navigation
Description
Summary
On an engine upgrade, the operator runs ALTER EXTENSION documentdb UPDATE but never updates documentdb_core. After the upgrade the cluster has mismatched extension versions.
Reproduction (Azure Local, combined image mode, operator 1.1.0)
- Create a cluster on the 0.117.0 test build (
spec.image.documentDB/gateway=…:0.117.0-build-42184844433-1-f6af3d1). Both extensions are0.117-0. - Update the binary to 1.0.0 (
spec.image: null,spec.documentDBVersion: "1.0.0"). - Finalize with
spec.schemaVersion: "1.0.0".
select extname, extversion from pg_extension where extname like 'documentdb%';
documentdb | 1.0-0
documentdb_core | 0.117-0 <- not updated
A fresh 1.0.0 cluster has both on 1.0-0, and pg_available_extensions shows documentdb_core default version 1.0-0 on the upgraded cluster.
Cause
HandleExtensionUpgrade / DetermineSchemaTarget only update r.extensionName() (documentdb): operator/src/internal/engine/extension.go:127, :267, :307. PostgreSQL's ALTER EXTENSION doesn't update dependencies. Upstream's upgrade procedure updates core first (documentdb-local/scripts/documentdb-setup.sh at v1.0-0):
-- ALTER EXTENSION does not update dependencies, so upgrade core first.
ALTER EXTENSION documentdb_core UPDATE;
ALTER EXTENSION documentdb UPDATE;Impact
- 0.117 → 1.0: none in practice; upstream
documentdb_core--0.117-0--1.0-0.sqlis empty. - Any future release whose
documentdb_coreupgrade script isn't empty: upgraded clusters run a newdocumentdbon an olddocumentdb_core. status.schemaVersionreports1.0.0while core is still0.117-0.
Suggested fix
Update dependent extensions (documentdb_core, then documentdb) in one transaction, to the same target version, both for auto and explicit schemaVersion. Consider making the dependency list part of the product profile (internal/product/documentdb.go). Add a test that checks both extension versions after an upgrade, plus an E2E check in the combined-mode engine-upgrade test.
Metadata
Metadata
Assignees
Type
Projects
- StatusShow more project fieldsIn progress
Activity
docs: link known upgrade issues documentdb#501 and documentdb#502 in …
documentdb-triage-tool commentedon Nov 6, 2026
🤖 Auto-triaged by documentdb-triage-tool.
Applied:
goProject fields suggested: Component
controllers· PriorityP2· EffortM· StatusTriageConfidence: 0.88 (llm)
Reasoning
LLM: Engine upgrade leaves documentdb_core at the old version, causing extension version mismatch; well-diagnosed with a clear fix, contained to the extension upgrade logic in one component.
If a label is wrong, remove it manually and ping
@patty-chowso the rules can be tuned. The bot will not re-label items that already have component labels.