Skip to content

Conversation

marceloneppel
Copy link
Member

@marceloneppel marceloneppel commented Jun 24, 2024

Issue

The PostgreSQL charm takes 9-10 minutes to start (be in an Active state).

Solution

  • Avoid the legacy upgrade code execution during the start process (because it's not needed while Patroni is still offline).
  • Set the primary status message earlier.
  • Add some debug logs of the time spent since the charm started until it reaches the Active state.
  • Enabled and fixed a hidden unit test (test_set_primary_status_message). It was not being executed because of indentation in the test function.

Debug logs when using this PR charm (4 minutes and 28 seconds from the beginning of the install hook until the workload is ready):

unit-postgresql-0: 20:28:18 DEBUG unit.postgresql/0.juju-log Install start time: 2024-06-24 20:28:18.945034
...
unit-postgresql-0: 20:32:46 DEBUG unit.postgresql/0.juju-log Active workload time: 2024-06-24 20:32:46.024307

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

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

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

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>
…strap

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

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

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 Jun 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.78%. Comparing base (dbd46b5) to head (7ce1eab).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #508      +/-   ##
==========================================
+ Coverage   69.21%   69.78%   +0.56%     
==========================================
  Files          11       11              
  Lines        2865     2866       +1     
  Branches      507      507              
==========================================
+ Hits         1983     2000      +17     
+ Misses        781      761      -20     
- Partials      101      105       +4     

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

@taurus-forever
Copy link
Contributor

Closed as duplicate of already merged #413
CC: @marceloneppel

@marceloneppel marceloneppel deleted the dpe-3882-simple-speedup-bootstrap branch July 11, 2025 14:24
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.

2 participants