Skip to content

feat(events): own the VM lifecycle, update-status, and restore-completion flows (5/7) - #359

Draft
marceloneppel wants to merge 1 commit into
vm-3bfrom
vm-4
Draft

marceloneppel wants to merge 1 commit into
vm-3bfrom
vm-4

Conversation

@marceloneppel

Copy link
Copy Markdown
Member

Issue

The VM charm's lifecycle orchestration (install/start/leader-elected/config-changed bootstrap, update-status, restore completion, teardown, rolling restart, actions) still lives charm-side; the lib's existing skeletons predate the current managers.

Solution

  • events/postgresql.py: faithful rewrite of the VM flows — leader-elected (password ensure incl. configured system-user secrets, members bootstrap, internal CA, endpoints), start (gates, member IP, storage layout, port, raft observer, bootstrap split), _start_primary (bootstrap + _setup_users + flags + extensions), _start_replica, the update-status family (+ _was_restore_successful, _handle_processes_failures), teardown (storage-detaching/remove), the rolling-ops _restart callback, and the get-primary/promote/secret handlers.
  • Composition: the abstract builds s3_client/BackupManager/RestoreManager/ObserverManager and passes every bridge; CannotConnectError; the PRIMARY_NOT_REACHABLE_MESSAGE literal.
  • Tests: tests/unit/test_vm_lifecycle_events.py (password ensure, update-status gates, teardown guards).

Checklist

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

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.

1 participant