diff --git a/charm_internal_version b/charm_internal_version index ec635144f..f599e28b8 100644 --- a/charm_internal_version +++ b/charm_internal_version @@ -1 +1 @@ -9 +10 diff --git a/lib/charms/mongodb/v0/config_server_interface.py b/lib/charms/mongodb/v0/config_server_interface.py index 3e1b42fa8..36ea8458c 100644 --- a/lib/charms/mongodb/v0/config_server_interface.py +++ b/lib/charms/mongodb/v0/config_server_interface.py @@ -42,7 +42,8 @@ # Increment this PATCH version before using `charmcraft publish-lib` or reset # to 0 if you are raising the major API version -LIBPATCH = 6 + +LIBPATCH = 7 class ClusterProvider(Object): @@ -240,6 +241,13 @@ def __init__( ) def _on_database_created(self, event) -> None: + if self.charm.upgrade_in_progress: + logger.warning( + "Processing client applications is not supported during an upgrade. The charm may be in a broken, unrecoverable state." + ) + event.defer() + return + if not self.charm.unit.is_leader(): return @@ -286,6 +294,7 @@ def _on_relation_changed(self, event) -> None: return self.charm.status.set_and_share_status(ActiveStatus()) + self.charm.mongos_intialised = True def _on_relation_broken(self, event: RelationBrokenEvent) -> None: # Only relation_deparated events can check if scaling down @@ -339,6 +348,13 @@ def pass_hook_checks(self, event): event.defer() return False + if self.charm.upgrade_in_progress: + logger.warning( + "Processing client applications is not supported during an upgrade. The charm may be in a broken, unrecoverable state." + ) + event.defer() + return False + return True def is_mongos_running(self) -> bool: