Skip to content

fix(mongodb): bound switchover completion - #3278

Draft
weicao wants to merge 9 commits into
mainfrom
brooks/mongodb-switchover-contract-r44
Draft

fix(mongodb): bound switchover completion#3278
weicao wants to merge 9 commits into
mainfrom
brooks/mongodb-switchover-contract-r44

Conversation

@weicao

@weicao weicao commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Problem

MongoDB switchover currently treats any non-primary role as success, invokes
syncer without a response deadline, and returns immediately after the request.
The syncer request only creates a completion ConfigMap; actual promotion is
complete when MongoDB HA deletes that token. A connected syncer that withholds
its response can also block indefinitely.

Change

  • validate exact primary/secondary roles and required identities;
  • submit exactly one syncer request under a 10-second bound;
  • observe exact completion-token deletion through six bounded kubectl probes;
  • preserve request/probe failures and timeout statuses without replay;
  • keep the script POSIX for every resolved MongoDB action image;
  • render all three switchover actions with the projected kubectl path,
    visible classified stderr, and a 50-second action ceiling; and
  • add a contract suite covering roles, candidates, failures, completion,
    all supported ComponentVersion image mappings, and tool producers.

Evidence

  • focused ShellSpec: Bash 3.2 24/0, Bash 5.3 24/0;
  • full MongoDB ShellSpec: Bash 3.2 102/0, Bash 5.3 102/0;
  • actual resolved 8.0.17 image: hanging request, hanging probe, and absent
    candidate rows pass;
  • Helm lint and default/custom-data-path renders pass;
  • POSIX sh -n, ShellCheck warning, diff-check, strict fsck, and clean
    worktree pass;
  • fresh independent design review: DESIGN_CLEAR / BLOCKER_LIST0;
  • fresh independent implementation review: APPROVE / BLOCKER_LIST0.

Boundaries

This PR contains static and container-local evidence only. It does not claim
Kubernetes runtime acceptance, package readiness, formal product N, merge,
deploy, or release readiness.

Open PR #3241 and PR #3110 remove the current kubectl producer from the same
ComponentDefinitions. Any future rebase must preserve both kubectl on the
selected data volume and syncerctl on /tools.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 244 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (8e745a4) to head (9824ce8).

Files with missing lines Patch % Lines
...ongodb/scripts-ut-spec/switchover_contract_spec.sh 0.00% 244 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##            main   #3278    +/-   ##
======================================
  Coverage   0.00%   0.00%            
======================================
  Files        165     166     +1     
  Lines      25632   25876   +244     
======================================
- Misses     25632   25876   +244     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants