feat(refresh): port the K8s refresh reconcile flow (5/6) - #272
Draft
marceloneppel wants to merge 1 commit into
Draft
feat(refresh): port the K8s refresh reconcile flow (5/6)#272marceloneppel wants to merge 1 commit into
marceloneppel wants to merge 1 commit into
Conversation
Ports the K8s charm's reconcile() - ensure the pgdata dirs and symlinks and reconcile the Pebble layers through new charm bridges (the storage helper and the layer generation stay behind those bridges until their own migration phases), wait for the member to rejoin with healthy replication, then allow the next unit to refresh - along with the charm-init resume block (on_init) for the Kubernetes substrate. The pebble-ready handler also gains the refresh safeguard ported from the charm: defer while a refresh is in progress and the workload is not allowed to start, with the refresh manager injected into the events handler.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
Part of the refresh module migration from the PostgreSQL VM and K8s charms' 16/edge branches into this library. Stacks on #265 and runs in parallel with the VM post-refresh flows PR.
Solution
Ports the K8s charm's
reconcile(): ensure the pgdata dirs and symlinks and reconcile the Pebble layers through new charm bridges (the storage helper and layer generation stay behind those bridges until their own migration phases), wait for the member to rejoin with healthy replication, then allow the next unit to refresh - along with the charm-init resume block (on_init) for the Kubernetes substrate.The pebble-ready handler gains the refresh safeguard ported from the charm: defer while a refresh is in progress and the workload is not allowed to start, with the refresh manager injected into the events handler. Note: the K8s charm referenced
is_replication_healthywithout calling it in the reconcile wait (an always-truthy bound method, so the wait only actually checked cluster membership); the library port calls the method, making the replication-health check effective. This makes the refresh resume gate stricter than 16/edge K8s: units with unhealthy replication now wait instead of proceeding.