Skip to content

refactor(refresh): use the refresh module from the single kernel library - #1942

Draft
marceloneppel wants to merge 1 commit into
16/edgefrom
dpe-refresh-vm-charm-migration
Draft

marceloneppel wants to merge 1 commit into
16/edgefrom
dpe-refresh-vm-charm-migration

Conversation

@marceloneppel

Copy link
Copy Markdown
Member

Issue

Part of the refresh module migration into the single kernel library (canonical/postgresql-single-kernel-library).

Solution

The VM charm now consumes the library's RefreshManager instead of owning its own refresh plumbing:

  • The charm-specific _PostgreSQLRefresh class and the refresh-only helpers (_post_snap_refresh, _reconcile_refresh_status, _check_and_update_internal_cert, _migrate_temp_tablespace_location, _execute_temp_tablespace_migration, _resolve_primary_host) are deleted — they now live in the library.
  • The collect-unit-status observer targets the manager's status reconciliation, keeping the refresh status gate and the "do not use collect status events elsewhere" contract intact.
  • The post-init resume block (snap-refresh flow, pre-refresh checks, temp tablespace migration) is replaced by RefreshManager.on_init().
  • set_unit_status delegates to the manager, and a refresh property keeps watcher.py and async_replication.py working unchanged.
  • Side effects owned by not-yet-migrated modules (exporters, pgBackRest service, watcher address) move behind a post_refresh_side_effects bridge, alongside the other duck-typed bridge methods (set_default_unit_status, set_app_status, get_async_primary_cluster_endpoint, has_async_replication_relation, update_relation_endpoints).
  • The library is pinned to the archive tarball of 9b26a57eb347e6dd79a31afbdc96c319a7600697 until the next release.

Unit tests that exercised the charm-side helpers are repointed at the manager's equivalents.

Checklist

  • I have added or updated any relevant documentation.
  • I have cleaned any remaining cloud resources from my accounts.

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
@github-actions github-actions Bot added the Libraries: Out of sync The charm libs used are out-of-sync label Sep 4, 2026

This branch has not been deployed

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

Labels

Libraries: Out of sync The charm libs used are out-of-sync

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant