Skip to content

Add MariaDB major version upgrade support (OSPRH-31231)#492

Draft
zzzeek wants to merge 1 commit into
openstack-k8s-operators:mainfrom
zzzeek:OSPRH-31231
Draft

Add MariaDB major version upgrade support (OSPRH-31231)#492
zzzeek wants to merge 1 commit into
openstack-k8s-operators:mainfrom
zzzeek:OSPRH-31231

Conversation

@zzzeek

@zzzeek zzzeek commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Adds spec.targetVersion to the Galera CR so the openstack-operator can signal a major version upgrade (e.g. "10.11"). When targetVersion differs from the deployed version recorded in status.clusterProperties, the controller adds TargetVersion to the ClusterProperties hash, triggering a full cluster stop via the existing StopRequired mechanism. On restart, an upgrade init container runs mysql_version_upgrade.sh before mysql_bootstrap.sh, starting mysqld in standalone mode and calling mariadb-upgrade against the node's PVC. Once the cluster bootstraps with the new image, status.clusterProperties["TargetVersion"] is advanced to match spec, removing the init container from subsequent StatefulSet reconciles.

Also adds hack/Containerfile.mariadb-10.11 for building a CentOS 9 based test image with MariaDB 10.11 community packages, to be used for prototyping and validating the upgrade path until a production RHEL 10 image is available.

@openshift-ci

openshift-ci Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci

openshift-ci Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: zzzeek
Once this PR has been reviewed and has the lgtm label, please assign abays for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

mkdir -p /usr/libexec && ln -s /usr/sbin/mysqld /usr/libexec/mysqld && \
mkdir -p /usr/lib64/galera && ln -s /usr/lib64/galera-4/libgalera_smm.so /usr/lib64/galera/libgalera_smm.so

USER mysql

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SO important

#!/bin/bash
set +eu

if [ "$(id -u)" != "$(id -u mysql)" ]; then

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is all stuff I added when i was testing with an image that didn't have "USER: mysql" in it. i think it's good to have for this kind of thing though.

@zzzeek zzzeek requested a review from dciabrin June 30, 2026 16:26
@zzzeek

zzzeek commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

I have a public image with mariadb 10.11 on top of RHEL9 at quay.io/rhn_engineering_mbayer/openstack-mariadb:10.11-test-4

@zzzeek zzzeek force-pushed the OSPRH-31231 branch 8 times, most recently from 95bb7a3 to d68ad90 Compare July 6, 2026 13:49
Adds spec.targetVersion to the Galera CR so the openstack-operator can
signal a major version upgrade (e.g. "10.11"). When targetVersion
differs from the deployed version recorded in status.clusterProperties,
the controller adds TargetVersion to the ClusterProperties hash,
triggering a full cluster stop via the existing StopRequired mechanism.
On restart, an upgrade init container runs mysql_version_upgrade.sh
before mysql_bootstrap.sh, starting mysqld in standalone mode and
calling mariadb-upgrade against the node's PVC. Once the cluster
bootstraps with the new image, status.clusterProperties["TargetVersion"]
is advanced to match spec, removing the init container from subsequent
StatefulSet reconciles.

Also adds hack/Containerfile.mariadb-10.11 for building a CentOS 9
based test image with MariaDB 10.11 community packages, to be used
for prototyping and validating the upgrade path until a production
RHEL 10 image is available.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@zzzeek

zzzeek commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

/test all

@openshift-ci

openshift-ci Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

@zzzeek: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/precommit-check 796c137 link true /test precommit-check

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant