From bbd358e56d1c2bb92aaf82dea052a77ee26eabf4 Mon Sep 17 00:00:00 2001 From: Mike Tonks Date: Thu, 9 Jul 2015 11:00:15 +0100 Subject: [PATCH] Increase verbosity of logging messages --- governor.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/governor.py b/governor.py index ee90eaf1..07322773 100755 --- a/governor.py +++ b/governor.py @@ -23,7 +23,9 @@ def stop_postgresql(): postgresql.stop() atexit.register(stop_postgresql) + # wait for etcd to be available +logging.info("Governor Starting up: Connect to Etcd") etcd_ready = False while not etcd_ready: try: @@ -35,12 +37,17 @@ def stop_postgresql(): # is data directory empty? if postgresql.data_directory_empty(): + logging.info("Governor Starting up: Empty Data Dir") # racing to initialize if etcd.race("/initialize", postgresql.name): + logging.info("Governor Starting up: Initialise Postgres") postgresql.initialize() + logging.info("Governor Starting up: Initialise Complete") etcd.take_leader(postgresql.name) + logging.info("Governor Starting up: Starting Postgres") postgresql.start() else: + logging.info("Governor Starting up: Sync Postgres from Leader") synced_from_leader = False while not synced_from_leader: leader = etcd.current_leader() @@ -48,15 +55,20 @@ def stop_postgresql(): time.sleep(5) continue if postgresql.sync_from_leader(leader): + logging.info("Governor Starting up: Sync Completed") postgresql.write_recovery_conf(leader) + logging.info("Governor Starting up: Starting Postgres") postgresql.start() synced_from_leader = True else: time.sleep(5) else: + logging.info("Governor Starting up: Existing Data Dir") postgresql.follow_no_leader() + logging.info("Governor Starting up: Starting Postgres") postgresql.start() +logging.info("Governor Running: Starting Running Loop") while True: logging.info(ha.run_cycle())