Skip to content

Commit

Permalink
fix: Temporary incorrect shard status
Browse files Browse the repository at this point in the history
During an update-status event, the shard status would show an incorrect
status "Charm is in sharding role: database. Does not support shard
interface".

This is due to the newly added checks a few weeks ago on the update
relation app databag.
Also, the status was incorrect.
  • Loading branch information
Gu1nness committed Oct 3, 2024
1 parent a100f6c commit e7449c3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -985,7 +985,8 @@ def _update_hosts(self, event: LeaderElectedEvent) -> None:
def _update_related_hosts(self, event) -> None:
# app relations should be made aware of the new set of hosts
try:
self.client_relations.update_app_relation_data()
if not self.is_role(Config.Role.SHARD):
self.client_relations.update_app_relation_data()
self.config_server.update_mongos_hosts()
self.cluster.update_config_server_db(event)
except PyMongoError as e:
Expand Down Expand Up @@ -1517,8 +1518,8 @@ def is_relation_feasible(self, rel_interface) -> bool:
)
logger.error(
"Charm is in sharding role: %s. Does not support %s interface.",
rel_interface,
self.role,
rel_interface,
)
return False

Expand Down

0 comments on commit e7449c3

Please sign in to comment.