Skip to content

patch(upgrades): event-agnostic backup/restore checks#235

Open
Gu1nness wants to merge 7 commits into8/edgefrom
fix/refreshes-objects-order
Open

patch(upgrades): event-agnostic backup/restore checks#235
Gu1nness wants to merge 7 commits into8/edgefrom
fix/refreshes-objects-order

Conversation

@Gu1nness
Copy link
Contributor

@Gu1nness Gu1nness commented Feb 6, 2026

🏷️ Type 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)
  • Documentation update
  • Tooling and CI
  • Dependencies upgrade or change
  • Chores / refactoring

📝 Description

Two issues where raised with a bug that affects upgrades.

If the charm is integrated with a backup solution, then the pre-refresh checks are failing from the get go because the backup_events object does not exist yet when the charm tries to access it.

This is fixed by adding some helper methods to check if backup/restore is in progress.

Closes: canonical/mongodb-k8s-operator#502
Closes: canonical/mongodb-operator#639

🧪 Manual testing steps

1. juju deploy <my-app> --channel 8/edge
2. juju deploy s3-integrator
3. juju run s3-integrator/leader sync-s3-credentials
4. juju config s3-integrator …
5. juju integrate s3-integrator mongodb
6. juju run mongodb/leader pre-refresh-check

🔬 Automated testing steps

Not yet added / To be discussed.

✅ Checklist

  • My code follows the code style of this project.
  • I have added or updated any relevant documentation.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

The upgrades objects must be created last in the refreshes so that all
other managers required are created before they are accessed.
This is because the refreshes entirely run in the __init__ function of
the refresh objects, which prevents access to objects that are created
after this object is created…
@Gu1nness Gu1nness changed the title patch(upgrades): Change the objects order patch(upgrades): event-agnostic backup/restore checks Feb 6, 2026
@Gu1nness Gu1nness force-pushed the fix/refreshes-objects-order branch from 902ef30 to 458a4ff Compare February 10, 2026 15:48
@Gu1nness Gu1nness force-pushed the fix/refreshes-objects-order branch from 89af926 to 950b4de Compare February 12, 2026 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deadlock upgrading from 8/edge to 8/stable Deadlock upgrading from 8/edge to 8/stable

2 participants