Skip to content

Conversation

dragomirp
Copy link
Contributor

@dragomirp dragomirp commented Jul 29, 2025

Sync 14 to 16:

  • Remove the pg_hba trigger

Checklist

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

github-actions bot and others added 20 commits May 28, 2025 15:07
Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com>
* add starter pack and sync tutorial with VM
* update deployment guides
* rename how-to-guides to how-to
* sync how-to guides with vm
* sync references with vm
* sync explanation pages with vm
* add .readthedocs.yaml and reduce .gitignore scope for requirements.txt file
* fix some formatting issues
* sync backup guides with vm
* fix misc. build errors and sync tutorial with vm
* add doc ci checks
* remove discourse sync workflow
* polish tutorial and deploy guide
* specify channel on all deploy commands
* sync misc. pages with vm
* minor README update with new documentation link
* ignore docs folder in development workflows
* remove sphinx python dependency check workflow
* update home page
* Fix auth username pattern

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

* Fix unit test

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

* Fix another ocurrence of the pattern

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

---------

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* chore: rename interfaces-endpoints for consistency with VM

* update references to interfaces-and-endpoints

* add rediraffe sphinx extension and redirect mapping list
* add starter pack and sync tutorial with VM

* update deployment guides

* rename how-to-guides to how-to

* sync how-to guides with vm

* sync references with vm

* sync explanation pages with vm

* add .readthedocs.yaml and reduce .gitignore scope for requirements.txt file

* fix some formatting issues

* sync backup guides with vm

* fix misc. build errors and sync tutorial with vm

* add doc ci checks

* remove discourse sync workflow

* polish tutorial and deploy guide

* specify channel on all deploy commands

* sync misc. pages with vm

* minor README update with new documentation link

* ignore docs folder in development workflows

* remove sphinx python dependency check workflow

* update home page

* fix some broken links

* fix broken links

* fix spelling errors in docs

* fix spelling errors in other markdown files

* small spelling fix
* Hold database created hook for pg_hba changes

* Restore the old blocking hook

* 16/edge lib changes

* Set to expected patch version
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
The pgBackRest activity (backup creation, stanza initialisation, etc) could take minutes,
as a result every minute logs rotation could move the current log A.log to A.log_$date.log
and will be moved further as logrorate rule operates all *.log files in the folder:

> /var/snap/charmed-postgresql/common/var/log/pgbackrest/*.log { ...

It results in:

-rw------- 1 postgres postgres     0 Feb 18 09:25 all-server.log
-rw------- 1 postgres postgres     0 Feb 18 09:19 all-server.log-20250218_09:18.log
-rw------- 1 postgres postgres     0 Feb 18 09:20 all-server.log-20250218_09:18.log-20250218_09:19.log
-rw------- 1 postgres postgres     0 Feb 18 09:21 all-server.log-20250218_09:18.log-20250218_09:19.log-20250218_09:20.log
-rw------- 1 postgres postgres     0 Feb 18 09:22 all-server.log-20250218_09:18.log-20250218_09:19.log-20250218_09:20.log-20250218_09:21.log
-rw------- 1 postgres postgres     0 Feb 18 09:23 all-server.log-20250218_09:18.log-20250218_09:19.log-20250218_09:20.log-20250218_09:21.log-20250218_09:22.log
-rw------- 1 postgres postgres  1793 Feb 18 09:24 all-server.log-20250218_09:18.log-20250218_09:19.log-20250218_09:20.log-20250218_09:21.log-20250218_09:22.log-20250218_09:23.log

The poposed fix:
* move the log file to the new name without .log suffix.
* use datetime format matching MySQL charms

Example:

-rw------- 1 postgres postgres    12 Feb 18 09:28 all-server.log
-rw------- 1 postgres postgres   322 Feb 18 09:29 all-server.log-20250218_0918
-rw------- 1 postgres postgres  7344 Feb 18 09:30 all-server.log-20250218_0918
* Update canonical/data-platform-workflows action to v32

* Switch release flow

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Dragomir Penev <dragomir.penev@canonical.com>
* Update libs

* Workflow tweaks

* Remove from_environ warning
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* More aggressive idle checks

* Explicit idle

* Idle period when relating to the test app

* Remove second start

* Remove log warning

* Hold create db hook for longer

* Bump the pg_hba checker timeout

* Don't update config

* Bump timeout

* Try to just append to pg_hba

* Sync hba changes before creating db resources

* Force regenerate hash and config on leader

* Use current host to check hba

* Update libs

* Compare to local hash

* Cla check for 16/edge

* Don't defer peer change before init

* Add back app check

* Revert back to just updating peer data

* Only sync hba once initially set

* Bump timeout

* Don't filter appends to pg_hba

* Append the rel users directly to the user map

* Add idle timeout

* Remove trigger

* Sleep longer

* Set extra user roles

* Always update hash

* Bump sleep period

* Revert the trigger

* Move generate_user_hash to charm

* Conditional hash update

* Try to sort keys

* Revert to relation user hash

* Try to reduce the amount of ifs

* Remove trigger

* Blocked test app
@dragomirp dragomirp added the not bug or enhancement PR is not 'bug' or 'enhancement'. For release notes label Jul 29, 2025
@dragomirp dragomirp changed the title Sync [MISC] Sync 14 to 16 Jul 29, 2025
Copy link

codecov bot commented Jul 29, 2025

Codecov Report

❌ Patch coverage is 60.81081% with 29 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.69%. Comparing base (efd9e19) to head (3fecd7a).
⚠️ Report is 1 commits behind head on 16/edge.

Files with missing lines Patch % Lines
src/charm.py 48.27% 13 Missing and 2 partials ⚠️
scripts/authorisation_rules_observer.py 80.00% 6 Missing ⚠️
src/authorisation_rules_observer.py 40.00% 6 Missing ⚠️
src/relations/postgresql_provider.py 60.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           16/edge    #1038      +/-   ##
===========================================
+ Coverage    72.33%   72.69%   +0.35%     
===========================================
  Files           14       14              
  Lines         3680     3713      +33     
  Branches       524      531       +7     
===========================================
+ Hits          2662     2699      +37     
+ Misses         821      815       -6     
- Partials       197      199       +2     

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not bumping patch, since it is to be replaced by v1.

Copy link
Contributor

Choose a reason for hiding this comment

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

Should v0/postgresql.py lib file be deleted?

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 need to port predefined roles to k8s to switch to v1.

Comment on lines +306 to +307
await ops_test.model.wait_for_idle(apps=[APPLICATION_NAME], status="blocked")
await ops_test.model.wait_for_idle(apps=[DATABASE_APP_NAME], status="active")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Additional changes on top of the merge. 16 is re-relating the test app so needs to check for blocked.

@dragomirp dragomirp marked this pull request as ready for review July 30, 2025 00:57
@dragomirp dragomirp requested a review from a team July 30, 2025 00:58
@dragomirp dragomirp requested review from marceloneppel and taurus-forever and removed request for a team July 30, 2025 00:58
Copy link
Contributor

Choose a reason for hiding this comment

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

Should v0/postgresql.py lib file be deleted?

Copy link
Member

@marceloneppel marceloneppel left a comment

Choose a reason for hiding this comment

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

Thank you so much!

@dragomirp dragomirp merged commit cffdd76 into 16/edge Jul 30, 2025
245 of 253 checks passed
@dragomirp dragomirp deleted the sync branch July 30, 2025 12:55
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.

5 participants