Skip to content

Commit

Permalink
Merge branch 'main' into start-shard-config-mongos
Browse files Browse the repository at this point in the history
  • Loading branch information
MiaAltieri committed Sep 19, 2023
2 parents ac78ed3 + 6fc7ccf commit 49cba1b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ def _connect_pbm_agent(self) -> None:
# Added to avoid systemd error:
# 'snap.charmed-mongodb.pbm-agent.service: Start request repeated too quickly'
time.sleep(1)
pbm_snap.start(services=[Config.Backup.SERVICE_NAME])
pbm_snap.start(services=[Config.Backup.SERVICE_NAME], enable=True)
except snap.SnapError as e:
logger.error(f"Failed to restart {Config.Backup.SERVICE_NAME}: {str(e)}")
self._get_service_status(Config.Backup.SERVICE_NAME)
Expand Down Expand Up @@ -1043,11 +1043,11 @@ def start_mongod_service(self):
"""
snap_cache = snap.SnapCache()
mongodb_snap = snap_cache["charmed-mongodb"]
mongodb_snap.start(services=["mongod"])
mongodb_snap.start(services=["mongod"], enable=True)

# charms running as config server are responsible for maintaining a server side mongos
if self.is_role(Config.Role.CONFIG_SERVER):
mongodb_snap.start(services=["mongos"])
mongodb_snap.start(services=["mongos"], enable=True)

def stop_mongod_service(self):
"""Stops the mongod service and if necessary stops mongos.
Expand Down Expand Up @@ -1122,7 +1122,7 @@ def start_backup_service(self) -> None:
"""
snap_cache = snap.SnapCache()
charmed_mongodb_snap = snap_cache["charmed-mongodb"]
charmed_mongodb_snap.start(services=["pbm-agent"])
charmed_mongodb_snap.start(services=["pbm-agent"], enable=True)

def restart_backup_service(self) -> None:
"""Restarts the pbm agent.
Expand Down

0 comments on commit 49cba1b

Please sign in to comment.