diff options
| author | Aravinda VK <avishwan@redhat.com> | 2016-10-20 15:05:38 +0530 | 
|---|---|---|
| committer | Aravinda VK <avishwan@redhat.com> | 2016-10-24 00:01:48 -0700 | 
| commit | cdc30ed8eacb6772e0dabb863ef51cef794d60dd (patch) | |
| tree | b7583e7fcda8c4871c1e4632c4ae86e7133fe6dc /geo-replication/syncdaemon/gsyncdstatus.py | |
| parent | ec64ce2e1684003f4e7a20d4372e414bfbddb6fb (diff) | |
geo-rep: Logging improvements
- Redundant log messages removed.
- Worker and connected slave node details added in "starting worker" log
- Added log for Monitor state change
- Added log for Worker status change(Initializing/Active/Passive/Faulty)
- Added log for Crawl status Change
- Added log for config set and reset
- Added log for checkpoint set, reset and completion
BUG: 1359612
Change-Id: Icc7173ff3c93de4b862bdb1a61760db7eaf14271
Signed-off-by: Aravinda VK <avishwan@redhat.com>
Reviewed-on: http://review.gluster.org/15684
Smoke: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Kotresh HR <khiremat@redhat.com>
Diffstat (limited to 'geo-replication/syncdaemon/gsyncdstatus.py')
| -rw-r--r-- | geo-replication/syncdaemon/gsyncdstatus.py | 14 | 
1 files changed, 12 insertions, 2 deletions
diff --git a/geo-replication/syncdaemon/gsyncdstatus.py b/geo-replication/syncdaemon/gsyncdstatus.py index f0836edbb26..c9938b5116f 100644 --- a/geo-replication/syncdaemon/gsyncdstatus.py +++ b/geo-replication/syncdaemon/gsyncdstatus.py @@ -17,6 +17,8 @@ import json  import time  from datetime import datetime  from errno import EACCES, EAGAIN, ENOENT +import logging +  from syncdutils import EVENT_GEOREP_ACTIVE, EVENT_GEOREP_PASSIVE, gf_event  from syncdutils import EVENT_GEOREP_CHECKPOINT_COMPLETED @@ -215,6 +217,10 @@ class GeorepStatus(object):                      data["checkpoint_time"] = checkpoint_time                      data["checkpoint_completion_time"] = curr_time                      data["checkpoint_completed"] = "Yes" +                    logging.info("Checkpoint completed. Checkpoint " +                                 "Time: %s, Completion Time: %s" % ( +                                     human_time_utc(checkpoint_time), +                                     human_time_utc(curr_time)))                      self.trigger_gf_event_checkpoint_completion(                          checkpoint_time, curr_time) @@ -223,10 +229,12 @@ class GeorepStatus(object):          self._update(merger)      def set_worker_status(self, status): -        self.set_field("worker_status", status) +        if self.set_field("worker_status", status): +            logging.info("Worker Status: %s" % status)      def set_worker_crawl_status(self, status): -        self.set_field("crawl_status", status) +        if self.set_field("crawl_status", status): +            logging.info("Crawl Status: %s" % status)      def set_slave_node(self, slave_node):          def merger(data): @@ -253,6 +261,7 @@ class GeorepStatus(object):      def set_active(self):          if self.set_field("worker_status", "Active"): +            logging.info("Worker Status: Active")              gf_event(EVENT_GEOREP_ACTIVE,                       master_volume=self.master,                       slave_host=self.slave_host, @@ -261,6 +270,7 @@ class GeorepStatus(object):      def set_passive(self):          if self.set_field("worker_status", "Passive"): +            logging.info("Worker Status: Passive")              gf_event(EVENT_GEOREP_PASSIVE,                       master_volume=self.master,                       slave_host=self.slave_host,  | 
