Skip to content

Conversation

marceloneppel
Copy link
Member

@marceloneppel marceloneppel commented Sep 11, 2025

Issue

If temp storage is using tmpfs and the unit is rebooted, that storage is remounted with wrong permissions, leading to failures when a database user tries to create temporary objects in the database.

Solution

Update the single kernel library dependency to fix the issue.

Add an integration test for checking that the tmpfs storage works after a reboot.

Depends on canonical/postgresql-single-kernel-library#11.

Checklist

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

…at tmpfs storage works after reboot

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
@marceloneppel marceloneppel changed the title Update single kernel library and add integration test for checking th… Update single kernel library to fix tmpfs ownership and permission after reboot Sep 11, 2025
…e-directory-permissions

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

codecov bot commented Sep 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.51%. Comparing base (798e91f) to head (fd7bd63).
⚠️ Report is 2 commits behind head on 16/edge.

❌ Your project status has failed because the head coverage (64.51%) 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    #1156   +/-   ##
========================================
  Coverage    64.51%   64.51%           
========================================
  Files           17       17           
  Lines         4337     4337           
  Branches       671      671           
========================================
  Hits          2798     2798           
  Misses        1357     1357           
  Partials       182      182           

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

pyproject.toml Outdated
charm-refresh = "^3.1.0.2"
httpx = "^0.28.1"
postgresql-charms-single-kernel = "^0.0.1"
postgresql-charms-single-kernel = {url = "https://github.com/canonical/postgresql-single-kernel-library/archive/59d9092301cc57ed0e15d6152373176fba49536e.zip"}
Copy link
Member Author

Choose a reason for hiding this comment

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

Need to be changed to 16.0.1 after canonical/postgresql-single-kernel-library#11 is merged and published.

@marceloneppel marceloneppel added the not bug or enhancement PR is not 'bug' or 'enhancement'. For release notes label Sep 11, 2025
@marceloneppel marceloneppel changed the title Update single kernel library to fix tmpfs ownership and permission after reboot [DPE-7584] Update single kernel library to fix tmpfs ownership and permission after reboot Sep 11, 2025
@marceloneppel marceloneppel marked this pull request as ready for review September 11, 2025 20:52
…e-directory-permissions

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

@taurus-forever taurus-forever left a comment

Choose a reason for hiding this comment

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

Why tests are so unstable (again?). 16/edge suposed to be more stable. Nope?

@marceloneppel
Copy link
Member Author

Why tests are so unstable (again?). 16/edge suposed to be more stable. Nope?

It's supposed. What's happening is the following: after a restore, the permissions of the storage directories are being set to a different value than the one that is set when the workload starts the database in a fresh cluster. I'm checking if there is a reason for that; otherwise, I'll fix those too.

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
This reverts commit 7263ae4.

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
…ermission when the instance is bootstrapped

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

Why tests are so unstable (again?). 16/edge suposed to be more stable. Nope?

The issue is described at canonical/postgresql-single-kernel-library#17 description.

I fixed the issue in that PR (and imported the code of the commit on this PR just to ensure it really fixes the issue).

I also fixed the directory permissions used in the configure_patroni_on_unit method to match what we expect and avoid more issues when restarting a unit. The remaining places where some permissions diverge need to be checked and fixed in a follow-up PR.

Copy link
Contributor

@taurus-forever taurus-forever left a comment

Choose a reason for hiding this comment

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

LGTM, should you use proper lib version?

pyproject.toml Outdated
charm-refresh = "^3.1.0.2"
httpx = "^0.28.1"
postgresql-charms-single-kernel = "^0.0.1"
postgresql-charms-single-kernel = {url = "https://github.com/canonical/postgresql-single-kernel-library/archive/a8a9cdaedbc11365773a80de7aa3b6bef58941f4.zip"}
Copy link
Contributor

Choose a reason for hiding this comment

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

16.0.2?

Copy link
Member Author

Choose a reason for hiding this comment

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

Exactly. Updated on fd7bd63.

…e-directory-permissions

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
@marceloneppel marceloneppel merged commit f9855c2 into 16/edge Oct 1, 2025
161 of 165 checks passed
@marceloneppel marceloneppel deleted the fix-temp-tablespace-directory-permissions branch October 1, 2025 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Libraries: Out of sync not bug or enhancement PR is not 'bug' or 'enhancement'. For release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants