Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
c2f8d9b
feat(storage): migrate all data mounts to versioned 16/main subdirect…
marceloneppel Apr 24, 2026
73bbade
fix: reinitialise temp tablespace after tmpfs wipe on reboot
marceloneppel Apr 24, 2026
c4f496d
fix(tests): assert versioned data_directory path in test_settings_are…
marceloneppel Apr 27, 2026
a0b9c61
fix(storage): skip temp tablespace migration while async replication …
marceloneppel Apr 28, 2026
8823c6c
feat(storage): perform forward migration in charm and add bidirection…
marceloneppel May 6, 2026
1ada8d4
Merge remote-tracking branch 'origin/16/edge' into feat/versioned-sto…
marceloneppel May 6, 2026
f29d5c1
refactor(storage): delegate data migration to snap hooks
marceloneppel May 7, 2026
734c218
test(upgrade): increase refresh timeouts to prevent spurious CI failures
marceloneppel May 8, 2026
23ce970
Merge remote-tracking branch 'origin/16/edge' into feat/versioned-sto…
marceloneppel May 8, 2026
f20eae0
refactor(storage): simplify temp tablespace migration to one-shot han…
marceloneppel May 8, 2026
48a4a61
docs: document pre-refresh hook handling of temp tablespace rollback
marceloneppel May 19, 2026
490a17d
Merge remote-tracking branch 'origin/16/edge' into feat/versioned-sto…
marceloneppel May 19, 2026
cea5cc3
fix(snap): update amd64 snap revision to 329 (fixes SNAP_CURRENT bug)
marceloneppel May 20, 2026
223eec6
Merge remote-tracking branch 'origin/16/edge' into feat/versioned-sto…
marceloneppel May 20, 2026
e2ae844
fix: remove unused imports
marceloneppel May 20, 2026
93e86a4
fix: update arm64 snap revision to 330 for versioned storage layout fix
marceloneppel May 21, 2026
b5558f1
fix(tests): increase sync_standby retry timeout in stereo mode primar…
marceloneppel May 21, 2026
cae703c
Merge remote-tracking branch 'origin/16/edge' into feat/versioned-sto…
marceloneppel May 21, 2026
7e2d815
fix(tests): increase verify_raft_cluster_health retry timeout for wat…
marceloneppel May 21, 2026
ba2f865
feat: add versioned storage layout migration for temp tablespace
marceloneppel May 25, 2026
68bbc66
Merge remote-tracking branch 'origin/16/edge' into feat/versioned-sto…
marceloneppel May 25, 2026
370dedf
fix: update snap revisions to 346/347 for versioned storage layout wi…
marceloneppel May 25, 2026
728e884
test: fix unit test
marceloneppel May 25, 2026
69c96fb
fix: resolve stale primary detection and WAL replay crash in temp tab…
marceloneppel May 25, 2026
8c6815d
fix: log actionable error when temp tablespace migration fails due to…
marceloneppel May 25, 2026
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: 3 additions & 3 deletions refresh_versions.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
charm_major = 1
workload = "16.13"
workload = "16.14"

[snap]
name = "charmed-postgresql"

[snap.revisions]
# amd64
x86_64 = "332"
x86_64 = "346"
# arm64
aarch64 = "331"
aarch64 = "347"
17 changes: 10 additions & 7 deletions src/backups.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@
from tenacity import RetryError, Retrying, stop_after_attempt, wait_fixed

from constants import (
ARCHIVE_DATA_DIR,
BACKUP_ID_FORMAT,
BACKUP_TYPE_OVERRIDES,
BACKUP_USER,
LOGS_DATA_DIR,
PATRONI_CONF_PATH,
PGBACKREST_ARCHIVE_TIMEOUT_ERROR_CODE,
PGBACKREST_BACKUP_ID_FORMAT,
Expand All @@ -42,7 +44,8 @@
PGBACKREST_LOG_LEVEL_STDERR,
PGBACKREST_LOGROTATE_FILE,
PGBACKREST_LOGS_PATH,
POSTGRESQL_DATA_PATH,
POSTGRESQL_DATA_DIR,
TEMP_DATA_DIR,
UNIT_SCOPE,
)
from relations.async_replication import REPLICATION_CONSUMER_RELATION, REPLICATION_OFFER_RELATION
Expand Down Expand Up @@ -245,7 +248,7 @@ def can_use_s3_repository(self) -> tuple[bool, str]:

return_code, system_identifier_from_instance, error = self._execute_command([
f"/snap/charmed-postgresql/current/usr/lib/postgresql/{self.charm._patroni.get_postgresql_version().split('.')[0]}/bin/pg_controldata",
POSTGRESQL_DATA_PATH,
POSTGRESQL_DATA_DIR,
])
if return_code != 0:
raise Exception(error)
Expand Down Expand Up @@ -353,10 +356,10 @@ def _create_bucket_if_not_exists(self) -> None:
def _empty_data_files(self) -> bool:
"""Empty the PostgreSQL data directory in preparation of backup restore."""
paths = [
"/var/snap/charmed-postgresql/common/data/archive",
POSTGRESQL_DATA_PATH,
"/var/snap/charmed-postgresql/common/data/logs",
"/var/snap/charmed-postgresql/common/data/temp",
ARCHIVE_DATA_DIR,
POSTGRESQL_DATA_DIR,
LOGS_DATA_DIR,
TEMP_DATA_DIR,
]
path = None
try:
Expand Down Expand Up @@ -1379,7 +1382,7 @@ def _render_pgbackrest_conf_file(self) -> bool:
enable_tls=len(self.charm._peer_members_ips) > 0,
peer_endpoints=self.charm._peer_members_ips,
path=s3_parameters["path"],
data_path=f"{POSTGRESQL_DATA_PATH}",
data_path=POSTGRESQL_DATA_DIR,
log_path=f"{PGBACKREST_LOGS_PATH}",
region=s3_parameters.get("region"),
endpoint=s3_parameters["endpoint"],
Expand Down
Loading
Loading