Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ options:
crashes and there are replicas.
type: string
default: "on"
durability_wal_keep_size:
description: |
Sets the minimum size of the WAL file to be kept for the replication.
Allowed values are: from 0 to 2147483647.
type: int
default: 4096
experimental_max_connections:
type: int
description: |
Expand Down
1 change: 1 addition & 0 deletions src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1925,6 +1925,7 @@ def update_config(self, is_creating_backup: bool = False, no_peers: bool = False
self._patroni.bulk_update_parameters_controller_by_patroni({
"max_connections": max_connections,
"max_prepared_transactions": self.config.memory_max_prepared_transactions,
"wal_keep_size": self.config.durability_wal_keep_size,
})

self._handle_postgresql_restart_need(enable_tls)
Expand Down
10 changes: 10 additions & 0 deletions src/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class CharmConfig(BaseConfigModel):
connection_statement_timeout: int | None
cpu_parallel_leader_participation: bool | None
durability_synchronous_commit: str | None
durability_wal_keep_size: int | None
experimental_max_connections: int | None
instance_default_text_search_config: str | None
instance_max_locks_per_transaction: int | None
Expand Down Expand Up @@ -205,6 +206,15 @@ def durability_synchronous_commit_values(cls, value: str) -> str | None:

return value

@validator("durability_wal_keep_size")
@classmethod
def durability_wal_keep_size_values(cls, value: int) -> int | None:
"""Check durability_wal_keep_size config option is between 0 and 2147483647."""
if value < 0 or value > 2147483647:
raise ValueError("Value is not between 0 and 2147483647")

return value

@validator("instance_password_encryption")
@classmethod
def instance_password_encryption_values(cls, value: str) -> str | None:
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_db_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ async def test_landscape_scalable_bundle_db(ops_test: OpsTest, charm: str) -> No
application_name=DATABASE_APP_NAME,
num_units=DATABASE_UNITS,
base=CHARM_BASE,
config={"profile": "testing"},
config={"durability_wal_keep_size": 0, "profile": "testing"},
)

# Deploy and test the Landscape Scalable bundle (using this PostgreSQL charm).
Expand Down