Skip to content

fix(mysql): fail update-parameter.sh on real SET GLOBAL errors#3080

Draft
weicao wants to merge 3 commits into
mainfrom
helios/mysql-update-parameter-error-handling
Draft

fix(mysql): fail update-parameter.sh on real SET GLOBAL errors#3080
weicao wants to merge 3 commits into
mainfrom
helios/mysql-update-parameter-error-handling

Conversation

@weicao

@weicao weicao commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Fixes #3079.

Per review discussion: reconfigure success cannot be judged from this single SET GLOBAL alone (parameters have primary-only / all-nodes / config-then-restart modes), so this change does NOT alter framework dispatch. It only separates "legitimately cannot apply online" from real errors:

  • ERROR 1238 (read-only variable): exit 0 with an explicit "takes effect after next restart" log — the framework has already persisted the value into the rendered my.cnf.
  • ERROR 1193 on a loose_-prefixed parameter: exit 0 — MySQL loose semantics (plugin not loaded), mirrored here. The loose_ strip is now prefix-anchored (${paramName#loose_}) instead of a global substring replace.
  • Anything else (unknown variable, invalid value, connection errors): exit 1 with the error on stderr so the Ops reflects reality.

Validation: bash -n pass. Runtime matrix for the mysql team via kubeblocks-tests before undraft: dynamic param happy path; static param via dynamic path (expect tolerated + restart-effective); invalid value (expect Ops fails); loose_ param without plugin (expect skipped).

🤖 Generated with Claude Code

Previously only ERROR 1045 failed the reconfigure exec action; every
other error (unknown variable, invalid value, connection failure) was
silently ignored and the Ops reported success while the running value
never changed. Now tolerate exactly the two legitimate cannot-apply-
online cases with explicit logs (1238 read-only -> effective after
restart via rendered my.cnf; 1193 on loose_-prefixed params -> plugin
not loaded), and exit non-zero on everything else. loose_ prefix strip
is now anchored to the prefix instead of a global substitution.

Fixes #3079

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

codecov-commenter commented Jul 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 113 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (35e0ded) to head (fbe80c6).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...ons/mysql/scripts-ut-spec/update_parameter_spec.sh 0.00% 113 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##            main   #3080    +/-   ##
======================================
  Coverage   0.00%   0.00%            
======================================
  Files        144     145     +1     
  Lines      23013   23126   +113     
======================================
- Misses     23013   23126   +113     

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

wei and others added 2 commits July 7, 2026 01:56
10 cases: numeric/suffix/quoting/dash-normalization apply paths with
query capture, tolerated 1238 and loose_+1193 paths, and hard-failure
paths (bare 1193, 1231, 1045, 2003).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A reconfigure of a variable removed in MySQL 8.4 (expire_logs_days,
master_info_repository, etc.) previously fell through to the config file
path and landed in my.cnf, crash-looping 8.4 on restart. Reject such a
request by name before SET GLOBAL when the server is >= 8.4, with a clear
reason surfaced in the action output. The SET GLOBAL unknown-variable
error remains a backstop; 8.0 keeps the legacy variables valid. Adds
ShellSpec coverage for 8.4-reject / 8.4-accept-non-removed / 8.0-legacy.

Refs #3085

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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: update-parameter.sh swallows SET GLOBAL errors — reconfigure false success

2 participants