summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKotresh HR <khiremat@redhat.com>2017-07-27 07:32:36 -0400
committerShyamsundar Ranganathan <srangana@redhat.com>2017-08-03 14:11:51 +0000
commit196bbf161adee731f818aa998158ddf8f7ba58ee (patch)
tree020dcb94d4a33dd6c6adb5db125f05af11f7fa40
parent498164fa45309bd314ff2fcc282b140edf72bc22 (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> (cherry picked from commit de69fb7ac819c7e92d132a5ead12ea317ef1ec20) Change-Id: I9bce950c5339b48d3ec8b84bddee38b0473b7634 Updates: #246 Signed-off-by: Kotresh HR <khiremat@redhat.com> Reviewed-on: https://review.gluster.org/17920 Reviewed-by: Aravinda VK <avishwan@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Smoke: Gluster Build System <jenkins@build.gluster.org>
-rw-r--r--geo-replication/syncdaemon/master.py27
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