Skip to content

Make native installer resume and day-two diagnostics deterministic and actionable #732

Open

Description

@GuanzhouSong

Summary

AMD64 native-installer E2E testing found four related recovery and day-two problems:

  1. Older packages-only receipts missing admin_user and listen_port silently resume with defaults.
  2. Gateway repair pays an injected startup delay twice.
  3. A healthy receipt for one PostgreSQL major is rejected when another manually configured major is also installed.
  4. Missing required packages are reported as generic service-health failures instead of naming the missing package.

Tested revision and environment

  • Commit: 9765074529b9f09ba05fc86a3cf7c5bb5caaa6eb
  • Architecture: AMD64
  • OS: Ubuntu 24.04
  • PostgreSQL: 17 and 18
  • Package manager: APT
  • Privileged systemd-as-PID-1 E2E environment

Reproduction

1. Older receipt missing choices

Start with an installed documentdb-18 package stack and a trusted receipt equivalent to:

schema=1
phase=packages-only
pg_major=18
package_family=apt
os_id=ubuntu
os_version_id=24.04
arch=amd64

Deliberately omit admin_user and listen_port, then resume:

sh install.sh --yes \
  --admin-password-file /root/pw \
  --accept-external-listen

2. Duplicate gateway startup delay

On a healthy completed installation, add a gateway systemd drop-in containing an injected startup delay:

[Service]
ExecStartPre=/bin/sleep 50

Stop or invalidate the gateway and rerun the installer while timing it.

The same test was also run with a 90-second delay.

3. Multiple installed majors

  1. Complete a healthy PG18 installation with a PG18 receipt.
  2. Install and manually configure the PG17 stack on separate ports.
  3. Rerun the installer for the existing PG18 receipt.

4. Missing required package

Force-remove a required package while preserving the rest of the completed stack:

dpkg --remove --force-depends documentdb-postgresql-tools
# or:
dpkg --remove --force-depends documentdb-common

sh install.sh --yes \
  --admin-password-file /root/pw \
  --accept-external-listen

Actual behavior

Missing receipt choices

The installer silently selects:

Admin user: admin
Gateway port: 10260

and completes using those defaults.

Duplicate delay

  • A 50-second injected delay completed after approximately 111 seconds.
  • A 90-second injected delay completed after approximately 191 seconds.

Repair starts the target and then explicitly restarts the gateway, paying the delay twice.

Multiple majors

The healthy PG18 installation is refused with:

ERROR: A different DocumentDB stand-alone PostgreSQL major is already installed.

even though the receipt-selected PG18 stack remains present and healthy.

Missing package

The underlying errors identify missing files or commands, for example:

cannot locate documentdb-tools-lib.sh

or:

documentdb-setup: not found

but the installer concludes with generic guidance:

ERROR: The completed installation is not healthy. Run 'sudo documentdb-setup --status ...'

This guidance may invoke a command from the package that is itself missing.

Expected behavior

  • Missing persisted choices must require an explicit operator choice rather than silently adopting defaults.
  • A repair should start/restart each service only once.
  • Health and no-op decisions should be scoped to the receipt-selected major.
  • Package inventory failures should be detected and diagnosed before service-health probing.

Impact

  • Legacy state can unexpectedly create the default administrator or move the listener to the default port.
  • Repairs take nearly twice the intended service startup timeout.
  • Supported multi-major package coexistence can block a healthy installation.
  • Operators receive misleading service guidance for a package-management problem and may be told to run a command that no longer exists.

Acceptance criteria

  • A packages-only receipt missing admin_user or listen_port requires those values interactively or through explicit flags.
  • Unattended resume fails before mutation when required choices are absent.
  • Receipt defaults are never used as implicit recovery decisions.
  • A gateway repair performs at most one effective gateway startup/restart.
  • Delay regressions demonstrate that a 50- or 90-second startup delay is paid once.
  • A healthy receipt-selected major is not rejected solely because another major is installed and independently configured.
  • Conflicting state for the selected major continues to fail closed.
  • Required-package completeness is checked before service health.
  • Errors name each missing or unpacked package and provide an appropriate reinstall/repair command.
  • Diagnostics never recommend running a command supplied by a package known to be missing.
  • Regression coverage includes all four scenarios.

Activity

  1. documentdb-triage-tool commented on Sep 2, 2026

    @documentdb-triage-tool

    🤖 Auto-triaged by documentdb-triage-tool.

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

    Reasoning

    LLM: Four distinct but related installer/day-two diagnostics bugs affecting resume correctness, repair performance, multi-major detection, and missing-package error reporting in the native installer E2E flow.

    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.

  2. added this to the 1.0 milestone on Oct 5, 2026
  3. documentdb-triage-tool commented on Oct 28, 2026

    @documentdb-triage-tool

    👋 @guanzhousongmicrosoft — this issue has been assigned for 23 days with no activity. Is it still in progress? If you've made progress, please leave a quick update. Otherwise it'll be flagged for re-assignment at the next triage meeting.

  4. documentdb-triage-tool commented on Nov 11, 2026

    @documentdb-triage-tool

    👋 @guanzhousongmicrosoft — this issue has been assigned for 14 days with no activity. Is it still in progress? If you've made progress, please leave a quick update. Otherwise it'll be flagged for re-assignment at the next triage meeting.

  5. guanzhousongmicrosoft commented on Nov 23, 2026

    @guanzhousongmicrosoft
    Member

    Items 3 and 4 are fixed on main (a92856b): a healthy install for the selected PostgreSQL major is no longer refused because another major is present, and missing packages are named with an apt/dnf repair command. Items 1 and 2 describe receipt-based resume and gateway-repair behavior the current installer no longer has; please confirm whether they still reproduce.

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

Metadata

Metadata

Labels

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions