diff --git a/.github/workflows/integration_test.yaml b/.github/workflows/integration_test.yaml index b730374b2b..54dcc04048 100644 --- a/.github/workflows/integration_test.yaml +++ b/.github/workflows/integration_test.yaml @@ -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 diff --git a/spread.yaml b/spread.yaml index 9a2c7ed1b6..d9d600c4fa 100644 --- a/spread.yaml +++ b/spread.yaml @@ -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: diff --git a/src/cluster.py b/src/cluster.py index 1c582f0e43..056f093e3c 100644 --- a/src/cluster.py +++ b/src/cluster.py @@ -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: diff --git a/src/upgrade.py b/src/upgrade.py index ed430e0cf4..08dee25eaf 100644 --- a/src/upgrade.py +++ b/src/upgrade.py @@ -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 @@ -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.""" @@ -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: diff --git a/tests/unit/test_upgrade.py b/tests/unit/test_upgrade.py index 1baac2da9b..22a186cbdb 100644 --- a/tests/unit/test_upgrade.py +++ b/tests/unit/test_upgrade.py @@ -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()