Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DPE-2289] [DPE-2388] Upgrade from 14/stable and add integration tests #210

Merged
merged 44 commits into from
Oct 16, 2023

Conversation

marceloneppel
Copy link
Member

@marceloneppel marceloneppel commented Jul 25, 2023

Issue

We cannot upgrade from 14/stable.

There are no integration tests for the upgrade process.

Solution

Add logic to correctly upgrade from 14/stable.

The monitoring user and its credentials are being created when upgrading from 14/stable (which doesn't have that user).

This also fixes the upgrade from a single unit cluster and updates the workload version.

Add tests that check if the upgrade succeeds, by using some assertions related to the upgrade lib and ensure that no writes from an application are lost during the upgrade process.

Base automatically changed from dpe-1769-minor-version-upgrade to main August 7, 2023 23:17
@marceloneppel marceloneppel changed the title [DPE-2289] Upgrade integration tests [DPE-2289] Upgrade from 14/stable and add integration tests Oct 9, 2023
@marceloneppel marceloneppel changed the title [DPE-2289] Upgrade from 14/stable and add integration tests [DPE-2289] [DPE-2388] Upgrade from 14/stable and add integration tests Oct 11, 2023
@marceloneppel marceloneppel marked this pull request as ready for review October 11, 2023 18:35
src/upgrade.py Outdated Show resolved Hide resolved
src/upgrade.py Outdated Show resolved Hide resolved
assert primary_name == f"{DATABASE_APP_NAME}/0"

local_charm = await ops_test.build_charm(".")
fault_charm = Path("/tmp/", local_charm.name)
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch. I'm gonna revisit this later.

src/charm.py Show resolved Hide resolved
@taurus-forever
Copy link
Contributor

@marceloneppel are we ready to merge this? I want to promote it to the 14/stable. Tnx!

@marceloneppel marceloneppel merged commit b4c51b0 into main Oct 16, 2023
31 checks passed
@marceloneppel marceloneppel deleted the dpe-2289-upgrade-integration-tests branch October 16, 2023 11:34
@marceloneppel
Copy link
Member Author

@marceloneppel are we ready to merge this? I want to promote it to the 14/stable. Tnx!

Merging now.

BON4 pushed a commit to BON4/postgresql-k8s-operator that referenced this pull request May 20, 2024
canonical#210)

* Added initial upgrade implementation

* Minor fixes

* Adjusted code to correctly update the upgrade stack and speed up the unit initialisation

* Minor fixes

* Updated the code with the new library

* Fixed upgrade logic to switchover to unit zero and added unit tests

* Added backup creation check

* Rollback dependencies

* Fixed dependencies

* Minor fixes

* Final fixes

* Removed upgrade integration tests

* Pin charmcraft revision

* Remove charmcraft pin

* Removed hashes from requirements

* Revert "Removed upgrade integration tests"

This reverts commit c249b44.

* Renamed overriden method

* Upgraded test

* Added replication health check and rock dependency

* Comment test

* Add additional upgrade logic for stable revision

* Fix partially the upgrade from stable

* Fix exporter startup

* Fix metrics service start

* Revert tests

* Format

* Lint

* Add test for upgrade from stable

* Add upgrade test

* Minor fixes

* Fix unit tests

* Fix unit tests patches

* PR feedback
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.

3 participants