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

(WIP) [DPE-5303] Update endpoints faster when snap is stopped #610

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

marceloneppel
Copy link
Member

@marceloneppel marceloneppel commented Sep 2, 2024

Issue

If the snap services are stopped manually by calling snap stop charmed.postgresql, the endpoints are not updated in the database relation endpoint, causing errors in the client charm side.

Solution

Improve the Cluster Topology Observer to check other members' REST API when the current member's REST API is not accessible.

This will allow the endpoint to be changed to the IP of the new primary before the update-status hook is called the next time.

I'm still working on making this more robust.

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Copy link

codecov bot commented Sep 9, 2024

Codecov Report

Attention: Patch coverage is 30.30303% with 23 lines in your changes missing coverage. Please review.

Project coverage is 70.60%. Comparing base (01cfd3e) to head (6b02bf1).

Files with missing lines Patch % Lines
src/cluster_topology_observer.py 20.00% 20 Missing ⚠️
src/cluster.py 50.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #610      +/-   ##
==========================================
- Coverage   70.81%   70.60%   -0.21%     
==========================================
  Files          12       12              
  Lines        3039     3055      +16     
  Branches      537      542       +5     
==========================================
+ Hits         2152     2157       +5     
- Misses        771      782      +11     
  Partials      116      116              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

…er-from-snap-service-stop

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
…er-from-snap-service-stop

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
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.

1 participant