Skip to content

Commit 7903d93

Browse files
authored
[DPE-6033] Preload shared libs on normal PG start (#774)
* Preload shared libs on normal PG start * Add resources
1 parent a72f3a8 commit 7903d93

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

templates/patroni.yml.j2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ postgresql:
115115
bin_dir: /usr/lib/postgresql/{{ version }}/bin
116116
listen: 0.0.0.0:5432
117117
parameters:
118+
shared_preload_libraries: 'timescaledb,pgaudit'
118119
{%- if enable_pgbackrest_archiving %}
119120
archive_command: 'pgbackrest --stanza={{ stanza }} archive-push %p'
120121
{% else %}

tests/integration/ha_tests/test_rollback_to_master_label.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
APPLICATION_NAME,
1818
CHARM_BASE,
1919
DATABASE_APP_NAME,
20+
METADATA,
2021
get_leader_unit,
2122
get_primary,
2223
get_unit_by_index,
@@ -108,8 +109,11 @@ async def test_fail_and_rollback(ops_test, continuous_writes) -> None:
108109

109110
application = ops_test.model.applications[DATABASE_APP_NAME]
110111

112+
resources = {"postgresql-image": METADATA["resources"]["postgresql-image"]["upstream-source"]}
113+
application = ops_test.model.applications[DATABASE_APP_NAME]
114+
111115
logger.info("Refresh the charm")
112-
await application.refresh(path=fault_charm)
116+
await application.refresh(path=fault_charm, resources=resources)
113117

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

tests/integration/ha_tests/test_upgrade_to_primary_label.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
CHARM_BASE,
1717
CHARM_SERIES,
1818
DATABASE_APP_NAME,
19+
METADATA,
1920
get_leader_unit,
2021
get_primary,
2122
get_unit_by_index,
@@ -100,8 +101,11 @@ async def test_upgrade(ops_test, continuous_writes) -> None:
100101
local_charm = await ops_test.build_charm(".")
101102
application = ops_test.model.applications[DATABASE_APP_NAME]
102103

104+
resources = {"postgresql-image": METADATA["resources"]["postgresql-image"]["upstream-source"]}
105+
application = ops_test.model.applications[DATABASE_APP_NAME]
106+
103107
logger.info("Refresh the charm")
104-
await application.refresh(path=local_charm)
108+
await application.refresh(path=local_charm, resources=resources)
105109

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

0 commit comments

Comments
 (0)