Skip to content

[MISC] Set Pgbackrest spool dir to archive mount #1025

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

Open
wants to merge 1 commit into
base: 16/edge
Choose a base branch
from

Conversation

dragomirp
Copy link
Contributor

Set spool path in Pgbackrest config to use the archive volume when restoring

Checklist

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

@dragomirp dragomirp added the bug Something isn't working as expected label Jul 3, 2025
Copy link

codecov bot commented Jul 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.35%. Comparing base (b17ece4) to head (ae67e1a).

Additional details and impacted files
@@             Coverage Diff             @@
##           16/edge    #1025      +/-   ##
===========================================
+ Coverage    72.33%   72.35%   +0.01%     
===========================================
  Files           14       14              
  Lines         3680     3682       +2     
  Branches       524      524              
===========================================
+ Hits          2662     2664       +2     
  Misses         821      821              
  Partials       197      197              

☔ 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.

@@ -1813,7 +1813,8 @@ def test_render_pgbackrest_conf_file(harness, tls_ca_chain_filename):
storage_path=harness.charm._storage_path,
user="backup",
retention_full=30,
process_max=max(cpu_count() - 2, 1),
process_max=2,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why hardcoded 2?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be getting the number of available cores from get_available_resources() in case of fractional limits and the output of it is patched above.

@@ -1184,6 +1185,7 @@ def _render_pgbackrest_conf_file(self) -> bool:
# Open the template pgbackrest.conf file.
with open("templates/pgbackrest.conf.j2") as file:
template = Template(file.read())
cpu_count, _ = self.charm.get_available_resources()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Get CPU from the helper to manage fractional limits.

@dragomirp dragomirp marked this pull request as ready for review July 3, 2025 21:00
@dragomirp dragomirp requested a review from marceloneppel July 3, 2025 21:00
@delgod
Copy link
Member

delgod commented Jul 4, 2025

Please excuse me, I was wrong, we need put spool dir to the same volume as WAL dir, but not inside WAL dir.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected Libraries: Out of sync
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants