Skip to content

test(e2e): cover combined-mode DocumentDB binary/schema upgrade with data preservation #489

Open

Description

@hossain-rayhan

Summary

Follow-up from #488 (review feedback). The E2E suite covers DocumentDB binary/schema upgrades only in ImageVolume mode. Add coverage for combined image mode (#487): upgrading spec.documentDBVersion must roll the CNPG cluster from documentdb-combined:18-<old> to documentdb-combined:18-<new>, run ALTER EXTENSION, and keep all data.

Background

  • In combined mode the operator derives the PostgreSQL image from the DocumentDB version: …/documentdb-combined:18-<version>. A version change patches CNPG spec.imageName, CNPG performs a rolling update, and the operator runs the schema migration once the primary is healthy.
  • The existing specs (test/e2e/tests/upgrade/upgrade_schema_test.go and upgrade_schema_auto_test.go) don't depend on the image mode. They create a cluster at defaultOldDocumentDBVersion (0.117.0), seed data, patch spec.documentDBVersion to defaultNewDocumentDBVersion (1.0.0), and verify schema migration and data. Today they only run on clusters where ImageVolume is available.
  • No combined image exists for 0.117.0. PGDG no longer packages 0.117, so it has to be built from source.

Proposed work

  1. Publish documentdb-combined:18-0.117.0 (one-off, manual):
    • Run RELEASE - Build DocumentDB Candidate Images with version: 0.117.0 and package_source: source.
    • Promote only the combined tag (docker buildx imagetools create -t …/documentdb-combined:18-0.117.0 …/documentdb-combined:18-<candidate>), so the released documentdb:0.117.0 and gateway:0.117.0 stay untouched.
    • Make sure the image is public for linux/amd64 and linux/arm64.
  2. Add combined-mode rows to the upgrade E2E group in .github/workflows/test-e2e.yml. At least one amd64 row with kind-feature-gates: ImageVolume=false on Kubernetes v1.33.7, and optionally kindest/node:v1.32.0 (containerd 1.7). The operator stays on the default imageMode: auto.
  3. Extend the schema-upgrade specs with combined-mode checks when the cluster runs in combined mode:
    • The documentdb.io/image-mode annotation is combined before and after the upgrade.
    • CNPG spec.imageName and status.documentDBImage move from 18-<old> to 18-<new>, with no extension image volumes.
    • status.schemaVersion and the pg_extension version reach the new version (two-step and auto).
    • Seeded data (counts, sample documents, indexes) survives.
  4. Docs: update the Testing section of docs/designs/combined-image-fallback.md.

Acceptance criteria

  • documentdb-combined:18-0.117.0 is published and public (amd64 and arm64).
  • The upgrade group has at least one combined-mode row that passes in CI.
  • The combined row checks the mode, the image transition, the schema migration and data preservation, for both two-step and auto schema upgrades.
  • ImageVolume-mode upgrade rows are unchanged and still pass.

Notes

  • Upkeep: later DocumentDB releases promote documentdb-combined:18-<version> automatically (release_documentdb_images.yml), so the "old" combined image will exist for future version pairs. Only 0.117.0 needs the one-off build.
  • No real 0.117.0 combined clusters exist: the 0.117.0 combined image is built with today's Dockerfile_combined, and combined mode ships with operator 1.1.0, so no customer can run a 0.117.0 combined cluster. The test validates the upgrade mechanics, not a historical image.
  • Out of scope: operator upgrades (1.0.0 → 1.1.0) are already covered by the existing upgrade group.

Activity

  1. documentdb-triage-tool commented on Nov 3, 2026

    @documentdb-triage-tool

    🤖 Auto-triaged by documentdb-triage-tool.

    Applied: test, enhancement
    Project fields suggested: Component test · Priority P2 · Effort L · Status Triage
    Confidence: 0.85 (llm)

    Reasoning

    LLM: Follow-up E2E coverage task spanning test specs, CI workflow matrix rows, a one-off image publish, and doc updates for the combined-image upgrade path.

    If a label is wrong, remove it manually and ping @patty-chow so the rules can be tuned. The bot will not re-label items that already have component labels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementtest

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions