Skip to content

fix(mariadb): add bounded Galera ordered shutdown#3108

Draft
weicao wants to merge 2 commits into
mainfrom
helen/mariadb-galera-parallel-shutdown
Draft

fix(mariadb): add bounded Galera ordered shutdown#3108
weicao wants to merge 2 commits into
mainfrom
helen/mariadb-galera-parallel-shutdown

Conversation

@weicao

@weicao weicao commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • keep Galera podManagementPolicy: Parallel and replace the inline preStop block with /scripts/galera-prestop.sh
  • add bounded shutdown ordering: lower ordinals wait for higher ordinals to stop, log degraded ordering on timeout, then still cleanly shut down locally
  • run local Galera shutdown cleanup as wsrep_desync=ON, wsrep_on=OFF, then mysqladmin shutdown
  • bump the MariaDB chart to 1.2.0-alpha.27 and add focused ShellSpec coverage

This supersedes PR #3105 as the selected route. PR #3105 remains useful only as the OrderedReady trade-off evidence and should not be merged.

Validation

  • bash -n addons/mariadb/scripts/galera-prestop.sh addons/mariadb/scripts/galera-start.sh
  • shellspec --load-path ./shellspec --shell bash addons/mariadb/scripts-ut-spec/galera_start_spec.sh addons/mariadb/scripts-ut-spec/galera_prestop_spec.sh addons/mariadb/scripts-ut-spec/galera_parallel_shutdown_template_spec.sh
    • 21 examples, 0 failures
  • helm dependency build addons/mariadb
  • helm template mariadb addons/mariadb >/tmp/mariadb-galera-render.yaml plus render grep confirmed:
    • mariadb-galera-1.2.0-alpha.27
    • podManagementPolicy: Parallel
    • mounted galera-prestop.sh
    • preStop calls /scripts/galera-prestop.sh

Full MariaDB ShellSpec was also run:

  • shellspec --load-path ./shellspec --shell bash addons/mariadb/scripts-ut-spec
    • 672 examples, 7 failures, 9 pendings
    • the 7 failures are all in replication_merged_replication_mode_env_wire_spec.sh, unrelated to the Galera files changed here

Runtime validation needed

Before marking ready, run IDC validation for:

  • fresh 3-node Galera create under Parallel
  • normal Stop/Start with grastate.dat proof and auto-recovery
  • high-ordinal safe_to_bootstrap=1 full force-delete recovery
  • abnormal/slow pod-1 shutdown timeout: bounded wait, degraded log, no indefinite block, no false success
  • T9/T10/T11/T12 no-regression scope

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 89 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (2e74b1d) to head (80cf583).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...ons/mariadb/scripts-ut-spec/galera_prestop_spec.sh 0.00% 55 Missing ⚠️
...-ut-spec/galera_parallel_shutdown_template_spec.sh 0.00% 24 Missing ⚠️
...adb/scripts-ut-spec/replication_switchover_spec.sh 0.00% 8 Missing ⚠️
...ripts-ut-spec/replication_user_convergence_spec.sh 0.00% 2 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main   #3108   +/-   ##
=====================================
  Coverage   0.00%   0.00%           
=====================================
  Files        144     146    +2     
  Lines      23013   23092   +79     
=====================================
- Misses     23013   23092   +79     

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

@weicao weicao added the nopick Not auto cherry-pick when PR merged label Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

nopick Not auto cherry-pick when PR merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants