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
11 changes: 1 addition & 10 deletions .github/workflows/integration_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,8 @@ jobs:
needs:
- collect-integration-tests
runs-on: ${{ matrix.job.runner }}
timeout-minutes: 226 # Sum of steps `timeout-minutes` + 5
timeout-minutes: 216 # Sum of steps `timeout-minutes` + 5
steps:
- name: Free up disk space
timeout-minutes: 10
run: |
printf '\nDisk usage before cleanup\n'
df --human-readable
# Based on https://github.com/actions/runner-images/issues/2840#issuecomment-790492173
rm -r /opt/hostedtoolcache/
printf '\nDisk usage after cleanup\n'
df --human-readable
- name: Checkout
timeout-minutes: 3
uses: actions/checkout@v5
Expand Down
3 changes: 3 additions & 0 deletions spread.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ backends:
sudo passwd -d runner

ADDRESS localhost

sudo mkdir -p /var/snap/lxd/common/lxd/storage-pools
sudo mount --bind /mnt /var/snap/lxd/common/lxd/storage-pools
# HACK: spread does not pass environment variables set on runner
# Manually pass specific environment variables
environment:
Expand Down
4 changes: 2 additions & 2 deletions src/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,8 +584,8 @@ def are_replicas_up(self) -> dict[str, bool] | None:
member["host"]: member["state"] in ["running", "streaming"]
for member in response.json()["members"]
}
except Exception:
logger.exception("Unable to get the state of the cluster")
except Exception as e:
logger.debug(f"Unable to get the state of the cluster: {e}")
return

def promote_standby_cluster(self) -> None:
Expand Down
4 changes: 3 additions & 1 deletion src/upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ def _on_upgrade_granted(self, event: UpgradeGrantedEvent) -> None:

self.charm.update_config()

self._set_up_new_access_roles_for_legacy()

self.set_unit_completed()

# Ensures leader gets its own relation-changed when it upgrades
Expand Down Expand Up @@ -258,7 +260,6 @@ def _prepare_upgrade_from_legacy(self) -> None:
extra_user_roles="pg_monitor",
)
self.charm.postgresql.set_up_database()
self._set_up_new_access_roles_for_legacy()

def _set_up_new_access_roles_for_legacy(self) -> None:
"""Create missing access groups and their memberships."""
Expand All @@ -271,6 +272,7 @@ def _set_up_new_access_roles_for_legacy(self) -> None:
self.charm.postgresql.create_access_groups()
self.charm.postgresql.grant_internal_access_group_memberships()
self.charm.postgresql.grant_relation_access_group_memberships()
logger.debug("Access roles created")

@property
def unit_upgrade_data(self) -> RelationDataContent:
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ def test_on_upgrade_granted(harness):
patch(
"charm.PostgresqlOperatorCharm.updated_synchronous_node_count"
) as _updated_synchronous_node_count,
patch("upgrade.PostgreSQLUpgrade._set_up_new_access_roles_for_legacy"),
):
# Test when the charm fails to start Patroni.
mock_event = MagicMock()
Expand Down