Skip to content

Propagate MariaDB TargetVersion to the Galera CR (OSPRH-32083) - #2069

Open
zzzeek wants to merge 1 commit into
openstack-k8s-operators:mainfrom
zzzeek:OSPRH-32083
Open

Propagate MariaDB TargetVersion to the Galera CR (OSPRH-32083)#2069
zzzeek wants to merge 1 commit into
openstack-k8s-operators:mainfrom
zzzeek:OSPRH-32083

Conversation

@zzzeek

@zzzeek zzzeek commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Adds ServiceDefaults.MariadbVersion to OpenStackVersion and propagates it to the Galera CR's spec.targetVersion, following the pattern already used by ServiceDefaults.RabbitmqVersion for the rabbitmq-server 3.9->4.2 upgrade.

Currently does not indicate a "default" version for mariadb-galera, as 10.5 is already deployed in existing deployments that dont have the "targetversion" field at all; setting it to 10.5 here would force a restart of those clusters.

Once this change is running on a rhel-10 environment with mariadb 10.11 available as the mariadb image,
the RELATED_IMAGE_MARIADB_IMAGE_URL_DEFAULT should be added as "10.11"; when deployed on an existing cluster that runs 10.5, this will apply the new version to the galera cluster which will then do a restart and run the mariadb upgrade scripts. Doing so before a 10.11 image is present would put running clusters into a state that includes MariaDBServerUpgradeReady=False with UpgradeVersionMismatch (however those clusters would still remain in a ready state).

References: OSPRH-32083

Adds ServiceDefaults.MariadbVersion to OpenStackVersion and propagates it
to the Galera CR's spec.targetVersion, following the pattern already used
by ServiceDefaults.RabbitmqVersion for the rabbitmq-server 3.9->4.2
upgrade.

Currently does not indicate a "default" version for mariadb-galera,
as 10.5 is already deployed in existing deployments that dont have the
"targetversion" field at all; setting it to 10.5 here would force a
restart of those clusters.

Once this change is running on a rhel-10 environment with mariadb 10.11
available as the mariadb image,
the RELATED_IMAGE_MARIADB_IMAGE_URL_DEFAULT should be added
as "10.11"; when deployed on an existing cluster that runs 10.5, this
will apply the new version to the galera cluster which will then do
a restart and run the mariadb upgrade scripts.  Doing so before
a 10.11 image is present would put running clusters into a
state that includes MariaDBServerUpgradeReady=False with
UpgradeVersionMismatch (however those clusters would still remain
in a ready state).

References: OSPRH-32083

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@openshift-ci
openshift-ci Bot requested review from abays and stuggi September 8, 2026 14:32
@zzzeek
zzzeek requested review from dciabrin and removed request for abays and stuggi September 8, 2026 14:32
@openshift-ci

openshift-ci Bot commented Sep 8, 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 slagle 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

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

OpenStackControlPlane CRD Size Report

Metric Value
CRD JSON size 338314 bytes (330KB)
Base branch size 338314 bytes
Change +0.00%
Status yellow — growing
Threshold reference
Color Range Meaning
🟢 green < 300KB Comfortable
🟡 yellow 300–400KB Growing
🟠 orange 400–750KB Concerning
🔴 red > 750KB Approaching 1.5MB etcd limit (cut in half to allow space for update)

@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Advanced

Run ID: 4a35b204-6eec-444d-b21c-947cde2deeac

📥 Commits

Reviewing files that changed from the base of the PR and between a8c16cf and 52e5554.

📒 Files selected for processing (8)
  • api/bases/core.openstack.org_openstackversions.yaml
  • api/core/v1beta1/openstackversion_types.go
  • api/core/v1beta1/zz_generated.deepcopy.go
  • bindata/crds/crds.yaml
  • config/crd/bases/core.openstack.org_openstackversions.yaml
  • internal/openstack/galera.go
  • internal/openstack/version.go
  • test/functional/ctlplane/openstackoperator_controller_test.go

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Summary

Summary by CodeRabbit

  • New Features

    • OpenStack version status now reports the configured MariaDB version.
    • MariaDB version settings can be propagated to Galera clusters during upgrades.
  • Bug Fixes

    • Existing clusters remain unaffected when no MariaDB version is configured, avoiding unnecessary restarts or upgrade actions.
    • MariaDB version upgrades are now applied consistently across the OpenStack control-plane Galera clusters.
  • Tests

    • Added coverage for both configured MariaDB upgrades and scenarios where the version remains unset.

Walkthrough

The change adds an optional MariaDB version to OpenStackVersion service defaults. Galera reconciliation applies the version to TargetVersion when set and keeps it empty otherwise. Functional tests cover both cases.

Changes

MariaDB version propagation

Layer / File(s) Summary
MariaDB version API contract
api/core/v1beta1/openstackversion_types.go, api/core/v1beta1/zz_generated.deepcopy.go, api/bases/..., config/crd/..., bindata/crds/crds.yaml
The ServiceDefaults API and CRD schemas add the optional mariadbVersion string field. Deep-copy support handles the pointer field.
Galera TargetVersion reconciliation
internal/openstack/version.go, internal/openstack/galera.go
Galera receives MariadbVersion when it is defined. Otherwise, TargetVersion remains empty. Initialization documents the current unset default.
MariaDB upgrade validation
test/functional/ctlplane/openstackoperator_controller_test.go
Functional tests verify empty TargetVersion for unset defaults and propagation of 10.11 to both Galera resources.

Priority: ➖ Normal — Schedule the MariaDB target-version propagation because it changes the OpenStackVersion API and Galera upgrade behavior while avoiding restarts for existing MariaDB 10.5 deployments.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 52e55

This adds optional MariaDB target-version propagation to Galera while retaining an empty target version for existing MariaDB 10.5 deployments, avoiding unintended cluster stops. The declared upgrade path is covered and no current merge-blocking risk remains.

Sequence Diagram(s)

sequenceDiagram
  participant OpenStackVersion
  participant OpenStackOperator
  participant GaleraOpenStack
  participant GaleraCell1
  OpenStackVersion->>OpenStackOperator: Provide ServiceDefaults.MariadbVersion
  OpenStackOperator->>GaleraOpenStack: Set Spec.TargetVersion
  OpenStackOperator->>GaleraCell1: Set Spec.TargetVersion
Loading

Suggested reviewers: stuggi

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: propagating MariaDB TargetVersion to the Galera CR.
Description check ✅ Passed The description accurately explains the new field, propagation behavior, upgrade rationale, and sequencing.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 5 files. (3 skipped: 3 …
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@centosinfra-prod-github-app

Copy link
Copy Markdown

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/rdoproject.org/buildset/d003558440a840c9857e39c96d0ebf6c

✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 50m 42s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 23m 42s
✔️ cifmw-crc-podified-edpm-baremetal SUCCESS in 1h 33m 08s
adoption-standalone-to-crc-ceph-provider POST_FAILURE in 2h 34m 00s
✔️ openstack-operator-tempest-multinode SUCCESS in 1h 39m 33s
✔️ openstack-operator-edpm-baremetal-minor-update SUCCESS in 1h 57m 41s

@zzzeek

zzzeek commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

/retest

@dciabrin
dciabrin requested a review from lmiccini September 9, 2026 08:16
@openshift-ci

openshift-ci Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

PR needs rebase.

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.

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