Skip to content

Commit

Permalink
fix: Temporary incorrect shard status (#501)
Browse files Browse the repository at this point in the history
## Issue

During an update-status event, the shard status would show an incorrect
status "Charm is in sharding role: database. Does not support shard
interface".

## Solution

This is due to the newly added checks a few weeks ago on the update
relation app databag. Fixed by running this handler only if we're not a
shard.
Also, the log line was incorrect, two arguments were swapped.
  • Loading branch information
Gu1nness authored Oct 4, 2024
1 parent 0a16ca2 commit 7d6d095
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 7d6d095

Please sign in to comment.