diff options
| author | Kotresh HR <khiremat@redhat.com> | 2017-07-27 07:32:36 -0400 | 
|---|---|---|
| committer | Aravinda VK <avishwan@redhat.com> | 2017-07-28 15:25:28 +0000 | 
| commit | de69fb7ac819c7e92d132a5ead12ea317ef1ec20 (patch) | |
| tree | 299336db19f938ab7e3a241b63a613f2003d68f2 | |
| parent | 1ae254ddcf397b101d291342272e13af25b0b1a1 (diff) | |
geo-rep: Convert gfid mismatch logs to structured logging
Convert the logs related to entry failures fix
due to gfid mismatch logs into structured logging
format
Change-Id: I9bce950c5339b48d3ec8b84bddee38b0473b7634
Updates: #246
Signed-off-by: Kotresh HR <khiremat@redhat.com>
Reviewed-on: https://review.gluster.org/17896
Smoke: Gluster Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Aravinda VK <avishwan@redhat.com>
| -rw-r--r-- | geo-replication/syncdaemon/master.py | 27 | 
1 files changed, 17 insertions, 10 deletions
diff --git a/geo-replication/syncdaemon/master.py b/geo-replication/syncdaemon/master.py index 9a53189348e..2aae860f5d1 100644 --- a/geo-replication/syncdaemon/master.py +++ b/geo-replication/syncdaemon/master.py @@ -796,8 +796,9 @@ class GMasterChangelogMixin(GMasterCommon):                  slave_gfid = failure[2]['slave_gfid']                  st = lstat(os.path.join(pfx, slave_gfid))                  if isinstance(st, int) and st == ENOENT: -                    logging.info ("Fixing gfid mismatch [%s]: Deleting %s" -                                  % (retry_count, repr(failure))) +                    logging.info(lf('Fixing gfid mismatch in slave. Deleting' +                                    ' the entry', retry_count=retry_count, +                                    entry=repr(failure)))                      #Add deletion to fix_entry_ops list                      pbname = failure[0]['entry']                      if failure[2]['slave_isdir']: @@ -812,8 +813,9 @@ class GMasterChangelogMixin(GMasterCommon):                      #The file exists on master but with different name.                      #Probabaly renamed and got missed during xsync crawl.                      if failure[2]['slave_isdir']: -                        logging.info ("Fixing gfid mismatch [%s]: %s" -                                      % (retry_count, repr(failure))) +                        logging.info(lf('Fixing gfid mismatch in slave', +                                        retry_count=retry_count, +                                        entry=repr(failure)))                          realpath = os.readlink(os.path.join(gconf.local_path,                                                              ".glusterfs",                                                              slave_gfid[0:2], @@ -825,18 +827,23 @@ class GMasterChangelogMixin(GMasterCommon):                                             entry=failure[0]['entry'],                                             entry1=dst_entry, stat=st,                                             link=None) -                        logging.info ("Fixing gfid mismatch [%s]: Renaming %s" -                                      % (retry_count, repr(rename_dict))) +                        logging.info(lf('Fixing gfid mismatch in slave. ' +                                        'Renaming', retry_count=retry_count, +                                        entry=repr(rename_dict)))                          fix_entry_ops.append(rename_dict)                      else: -                        logging.info ("Fixing gfid mismatch [%s]: Deleting %s" -                                      % (retry_count, repr(failure))) +                        logging.info(lf('Fixing gfid mismatch in slave. ' +                                        ' Deleting the entry', +                                        retry_count=retry_count, +                                        entry=repr(failure)))                          pbname = failure[0]['entry']                          fix_entry_ops.append(edct('UNLINK',                                                    gfid=failure[2]['slave_gfid'],                                                    entry=pbname)) -                        logging.error ("GFID MISMATCH: ENTRY CANNOT BE FIXED: " -                                       "gfid: %s" % slave_gfid) +                        logging.error(lf('Entry cannot be fixed in slave due ' +                                         'to GFID mismatch, find respective ' +                                         'path for the GFID and trigger sync', +                                         gfid=slave_gfid))          if fix_entry_ops:              #Process deletions of entries whose gfids are mismatched  | 
