Skip to content

Commit

Permalink
[DPE-6033] Preload shared libs on normal PG start (#774)
Browse files Browse the repository at this point in the history
* Preload shared libs on normal PG start

* Add resources
  • Loading branch information
dragomirp authored Nov 19, 2024
1 parent a72f3a8 commit 7903d93
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions templates/patroni.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ postgresql:
bin_dir: /usr/lib/postgresql/{{ version }}/bin
listen: 0.0.0.0:5432
parameters:
shared_preload_libraries: 'timescaledb,pgaudit'
{%- if enable_pgbackrest_archiving %}
archive_command: 'pgbackrest --stanza={{ stanza }} archive-push %p'
{% else %}
Expand Down
6 changes: 5 additions & 1 deletion tests/integration/ha_tests/test_rollback_to_master_label.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
APPLICATION_NAME,
CHARM_BASE,
DATABASE_APP_NAME,
METADATA,
get_leader_unit,
get_primary,
get_unit_by_index,
Expand Down Expand Up @@ -108,8 +109,11 @@ async def test_fail_and_rollback(ops_test, continuous_writes) -> None:

application = ops_test.model.applications[DATABASE_APP_NAME]

resources = {"postgresql-image": METADATA["resources"]["postgresql-image"]["upstream-source"]}
application = ops_test.model.applications[DATABASE_APP_NAME]

logger.info("Refresh the charm")
await application.refresh(path=fault_charm)
await application.refresh(path=fault_charm, resources=resources)

logger.info("Get first upgrading unit")
# Highest ordinal unit always the first to upgrade.
Expand Down
6 changes: 5 additions & 1 deletion tests/integration/ha_tests/test_upgrade_to_primary_label.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
CHARM_BASE,
CHARM_SERIES,
DATABASE_APP_NAME,
METADATA,
get_leader_unit,
get_primary,
get_unit_by_index,
Expand Down Expand Up @@ -100,8 +101,11 @@ async def test_upgrade(ops_test, continuous_writes) -> None:
local_charm = await ops_test.build_charm(".")
application = ops_test.model.applications[DATABASE_APP_NAME]

resources = {"postgresql-image": METADATA["resources"]["postgresql-image"]["upstream-source"]}
application = ops_test.model.applications[DATABASE_APP_NAME]

logger.info("Refresh the charm")
await application.refresh(path=local_charm)
await application.refresh(path=local_charm, resources=resources)

logger.info("Get first upgrading unit")
# Highest ordinal unit always the first to upgrade.
Expand Down

0 comments on commit 7903d93

Please sign in to comment.