Skip to content

fix(mysql): orc switchover fails closed when Orchestrator is unreachable#3078

Draft
weicao wants to merge 1 commit into
mainfrom
helios/mysql-orc-switchover-fail-closed
Draft

fix(mysql): orc switchover fails closed when Orchestrator is unreachable#3078
weicao wants to merge 1 commit into
mainfrom
helios/mysql-orc-switchover-fail-closed

Conversation

@weicao

@weicao weicao commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Fixes #3077.

Root-cause-only change in orc-switchover.sh:

  • which-cluster-master / which-cluster-instances no longer capture stderr into the result; the client's exit code is checked explicitly and query failure exits 1 (kbagent retry drives convergence per the 05c contract).
  • instance count now counts non-empty lines and uses -le 1.
  • the failure message prints the actual exit code plus output.

Pre-flight guards (role check, not-the-master skip, single-instance skip, graceful-master-takeover-auto flow) are unchanged.

Validation: bash -n pass. Runtime validation (switchover with Orchestrator down must fail the Ops, switchover with Orchestrator up must succeed) to be run by the mysql addon team via kubeblocks-tests before undraft.

🤖 Generated with Claude Code

…achable

Stop merging orchestrator-client stderr into command substitutions:
error text was parsed as a master name / instance list, making the two
skip-guards exit 0 and a failed switchover report success. Check the
client exit code explicitly and exit non-zero on query failure; count
instances from non-empty lines only; include the real exit code in the
failure message.

Fixes #3077

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (35e0ded) to head (543cdb4).

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #3078   +/-   ##
=====================================
  Coverage   0.00%   0.00%           
=====================================
  Files        144     144           
  Lines      23013   23013           
=====================================
  Misses     23013   23013           

☔ 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.

mysql(orc): switchover reports success when Orchestrator is unreachable

2 participants