Skip to content

fix: deduplicate installer functions and harden backup/restore flows#3

Open
yuanyp8 wants to merge 1 commit into
mainfrom
codex/fix-multiple-script-issues-in-install.sh
Open

fix: deduplicate installer functions and harden backup/restore flows#3
yuanyp8 wants to merge 1 commit into
mainfrom
codex/fix-multiple-script-issues-in-install.sh

Conversation

@yuanyp8

@yuanyp8 yuanyp8 commented Apr 5, 2026

Copy link
Copy Markdown
Contributor

Motivation

  • Remove duplicated function definitions to eliminate override ambiguity and improve maintainability.
  • Prevent backup/restore/verify flows from failing silently due to implicit root-password fallback and improve UX for external MySQL targets.
  • Make restore/snapshot selection and NFS backup behavior more robust when files/permissions are missing.
  • Improve benchmark observability and avoid unstable log-following behavior.

Description

  • Deduplicated and consolidated implementations in install.sh (kept single active definitions for parsing, auth preparation, backup/restore/benchmark flows and helper functions), and added --registry and --nodeport-enabled parameters with NODEPORT_ENABLED flag and optional NodePort manifest block rendering in manifests/innodb-mysql.yaml.
  • Hardened auth handling so backup|restore|verify-backup-restore now require an explicit --mysql-password or --mysql-auth-secret, updated prepare_runtime_auth_secret to fail fast for those actions, and added precheck_mysql_connectivity() which validates MySQL connectivity before launching backup/restore/verify jobs (calls added to run_backup, run_restore, verify_backup_restore).
  • Made restore snapshot resolution resilient: when latest.txt points to a missing snapshot the code falls back to the newest existing *.sql.gz, and added an NFS write test (touch) during backup to fail early if snapshot directory is not writable; these changes are in manifests/mysql-backup-support.yaml.
  • Improved benchmark logic by changing prepare-buffer calculation to ceiling division with a reasonable lower bound, replacing repeated kubectl logs -f followers with periodic kubectl logs --tail=10 polling to avoid multiple background followers, and emitting a JSON report (in addition to text) plus MySQL-8 specific compat args in manifests/mysql-benchmark-job.yaml.

Testing

  • Ran bash -n install.sh to validate shell syntax and it returned no errors (success).
  • Verified duplicate-function removal with an awk scan that shows no remaining duplicated name() { ... } definitions in install.sh (success).
  • Committed changes and updated affected manifests: install.sh, manifests/innodb-mysql.yaml, manifests/mysql-backup-support.yaml, and manifests/mysql-benchmark-job.yaml.

Codex Task

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant