Skip to content

[DPE-7726] Use Patroni API for is_restart_pending() (instead of SQL select from pg_settings) #1049

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

Draft
wants to merge 4 commits into
base: 16/edge
Choose a base branch
from

Conversation

taurus-forever
Copy link
Contributor

Issue

The previous is_restart_pending() waited for 15 seconds due to the
Patroni's loop_wait default value (10 seconds), which tells how much time
Patroni will wait before checking the configuration file again to reload it.

Solution

Instead of checking PostgreSQL pending_restart from pg_settings,
check Patroni API pending_restart=True/undefined.

Checklist

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

Copy link

codecov bot commented Jul 15, 2025

Codecov Report

❌ Patch coverage is 29.54545% with 31 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.53%. Comparing base (823e0a0) to head (e31de74).

Files with missing lines Patch % Lines
src/charm.py 30.76% 16 Missing and 2 partials ⚠️
src/cluster.py 23.52% 13 Missing ⚠️

❌ Your patch check has failed because the patch coverage (29.54%) is below the target coverage (33.00%). You can increase the patch coverage or adjust the target coverage.
❌ Your project check has failed because the head coverage (64.53%) is below the target coverage (70.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff             @@
##           16/edge    #1049      +/-   ##
===========================================
- Coverage    65.84%   64.53%   -1.31%     
===========================================
  Files           17       17              
  Lines         4178     4182       +4     
  Branches       609      593      -16     
===========================================
- Hits          2751     2699      -52     
- Misses        1284     1351      +67     
+ Partials       143      132      -11     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@taurus-forever taurus-forever changed the title Use Patroni API for is_restart_pending() [DPE-7726] Use Patroni API for is_restart_pending() (instead of SQL select from pg_settings) Jul 15, 2025
@taurus-forever taurus-forever force-pushed the alutay/is_restart_pending branch 2 times, most recently from 2a8dae4 to 668abd3 Compare July 31, 2025 11:49
@taurus-forever taurus-forever force-pushed the alutay/is_restart_pending branch 2 times, most recently from b6ed998 to 2c689b0 Compare August 2, 2025 00:15
* Also use common logger everywhere.

(cherry picked from commit 0d332d9c22c6acb96a165576b9488c7fa31734f6)
@taurus-forever taurus-forever force-pushed the alutay/is_restart_pending branch from 9c17d76 to e31de74 Compare August 2, 2025 00:40
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