Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

refactor!: make database a singleton #1462

Merged
merged 5 commits into from
Oct 8, 2020
Merged

Conversation

f0rmiga
Copy link
Member

@f0rmiga f0rmiga commented Oct 7, 2020

Description

Removed the possibility of doing HA with the PXC database provided as part of KubeCF. It's currently not feasible to maintain a reliable HA setup as part of KubeCF.

Motivation and Context

When the active node doing writes is terminated in the middle of replication (e.g. going from SA to HA as part of an upgrade), the data is left broken.

How Has This Been Tested?

Locally. CI.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code has security implications.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

mook-as and others added 2 commits October 7, 2020 10:17
Don't use the full labels (including the version) for the selector for
the database.
BREAKING CHANGE:

Maintaining the database integrity while doing Galera replication is
currently not feasible in k8s as part of KubeCF.

The general recommendation for doing HA database is to use an external
database that supports this setup.

Signed-off-by: Thulio Ferraz Assis <thulio.assis@suse.com>
@f0rmiga f0rmiga requested a review from mook-as October 7, 2020 21:15
@mook-as mook-as added the changelog Issue must be present in the release notes. label Oct 7, 2020
Copy link
Contributor

@mook-as mook-as left a comment

Choose a reason for hiding this comment

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

Please edit unsupported.yaml to explicitly let users know that this is no longer supported.

/cc @fargozhu for release notes.

chart/templates/database/db-statefulset.yaml Outdated Show resolved Hide resolved
chart/templates/database/db-statefulset.yaml Show resolved Hide resolved
chart/values.yaml Show resolved Hide resolved
Thulio Ferraz Assis and others added 2 commits October 7, 2020 16:29
Co-authored-by: Mark Yen <3977982+mook-as@users.noreply.github.com>
Signed-off-by: Thulio Ferraz Assis <thulio.assis@suse.com>
@f0rmiga
Copy link
Member Author

f0rmiga commented Oct 7, 2020

@mook-as Please, check b31d215 if it's the expected message.

@f0rmiga f0rmiga requested a review from mook-as October 7, 2020 21:34
Copy link
Contributor

@mook-as mook-as left a comment

Choose a reason for hiding this comment

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

Nitpicks around phrasing.

chart/config/unsupported.yaml Outdated Show resolved Hide resolved
chart/templates/database/db-statefulset.yaml Show resolved Hide resolved
@jandubois
Copy link
Member

Is it safe to downgrade the database from HA to SA when upgrading kubecf? If not, then maybe the "unsupported" error should include some guidance to scale down the database before upgrading? (Assuming that is safe; or can that too still lead to data loss?)

@f0rmiga
Copy link
Member Author

f0rmiga commented Oct 8, 2020

Is it safe to downgrade the database from HA to SA when upgrading kubecf? If not, then maybe the "unsupported" error should include some guidance to scale down the database before upgrading? (Assuming that is safe; or can that too still lead to data loss?)

@jandubois Going from HA to SA should be safe if the active replica is the database-0.
@viovanov Is there a way to instruct the active-passive controller to use the database-0?

Co-authored-by: Mark Yen <3977982+mook-as@users.noreply.github.com>
@f0rmiga f0rmiga requested a review from mook-as October 8, 2020 01:26
@viovanov
Copy link
Member

viovanov commented Oct 8, 2020

@f0rmiga afaik it will always scale to the 0 ordinal

@viovanov viovanov merged commit 888b997 into master Oct 8, 2020
@viovanov viovanov deleted the f0rmiga/singleton-database branch October 8, 2020 08:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
changelog Issue must be present in the release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants