Skip to content

feat(mysql): classify removed 8.4 parameters#3224

Draft
weicao wants to merge 4 commits into
helios/mysql-84-paramsdeffrom
william/mysql-84-invalid-parameter-optin
Draft

feat(mysql): classify removed 8.4 parameters#3224
weicao wants to merge 4 commits into
helios/mysql-84-paramsdeffrom
william/mysql-84-invalid-parameter-optin

Conversation

@weicao

@weicao weicao commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Problem

KubeBlocks controller PR #10684 adds an opt-in action result policy for deterministic rejected parameters. MySQL 8.4 already rejects a fixed set of removed variables before SET GLOBAL, but that path currently shares generic exit code 1 with authentication, connection, probe, unknown-variable, and other execution failures. Mapping exit 1 would therefore misclassify infrastructure or engine errors as InvalidParameter.

Change

  • return dedicated exit code 64 only when the server version is parseable as MySQL 8.4+ and the normalized parameter is in the fixed eight-member removed-variable list
  • map only exit code 64 to InvalidParameter with retry: false in the shared reconfigure action
  • retain generic exit code 1 for all other failures
  • cite the upstream MySQL removed-features source and require a dedicated test for each list member
  • render-test all seven MySQL reconfigure actions and assert no exit-code-1 mapping

This PR is stacked on #3086 (helios/mysql-84-paramsdef) and includes the three commits from #3080 that provide the generic error and removed-variable foundation.

TDD evidence

Before the product patch, the focused suite was 22 examples / 9 failures: all eight removed-variable cases returned 1 instead of 64 and the seven rendered actions had no result mapping.

After the patch:

  • focused ShellSpec: 23 examples / 0 failures
  • all MySQL ShellSpec: 29 examples / 0 failures
  • Bash syntax: PASS
  • ShellCheck severity error: PASS
  • Helm lint: PASS
  • Helm render + structured parse: seven reconfigure actions, each with exactly [{execExitCode: 64, code: InvalidParameter, retry: false}]
  • git diff --check: PASS
  • isolated implementation review: no blocking finding

Runtime boundary

Runtime is N=0 / NOT_RUN. Acceptance requires controller manager and Pod kbagent sidecar built from the exact same #10684 head, then the focused MySQL 8.4 rejected-parameter rollback and subsequent valid reconfigure checks.

wei and others added 4 commits July 16, 2026 19:15
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>
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>
@weicao
weicao requested review from a team, leon-ape and xuriwuyun as code owners July 16, 2026 11:29
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 177 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (db05fdc) to head (e4b569c).

Files with missing lines Patch % Lines
...ons/mysql/scripts-ut-spec/update_parameter_spec.sh 0.00% 161 Missing ⚠️
...pts-ut-spec/update_parameter_result_policy_spec.sh 0.00% 16 Missing ⚠️
Additional details and impacted files
@@                    Coverage Diff                     @@
##           helios/mysql-84-paramsdef   #3224    +/-   ##
==========================================================
  Coverage                       0.00%   0.00%            
==========================================================
  Files                            147     149     +2     
  Lines                          23282   23459   +177     
==========================================================
- Misses                         23282   23459   +177     

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

@leon-ape
leon-ape marked this pull request as draft July 20, 2026 02:53
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