233933
From c4e292379928eaf1ebb47ee1c8e9b1eabbe90574 Mon Sep 17 00:00:00 2001
233933
From: Kotresh HR <khiremat@redhat.com>
233933
Date: Tue, 14 May 2019 11:05:45 +0530
233933
Subject: [PATCH 170/178] geo-rep: Convert gfid conflict resolutiong logs into
233933
 debug
233933
233933
The gfid conflict resolution code path is not supposed
233933
to hit in generic code path. But few of the heavy rename
233933
workload (BUG: 1694820) makes it a generic case. So
233933
logging the entries to be fixed as INFO floods the log
233933
in these particular workloads. Hence convert them to DEBUG.
233933
233933
Backport of:
233933
 > Patch: https://review.gluster.org/22720
233933
 > fixes: bz#1709653
233933
 > Change-Id: I4d5e102b87be5fe5b54f78f329e588882d72b9d9
233933
233933
BUG: 1714536
233933
Change-Id: I4d5e102b87be5fe5b54f78f329e588882d72b9d9
233933
Signed-off-by: Kotresh HR <khiremat@redhat.com>
233933
Reviewed-on: https://code.engineering.redhat.com/gerrit/172731
233933
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
233933
---
233933
 geo-replication/syncdaemon/master.py | 21 ++++++++++++---------
233933
 1 file changed, 12 insertions(+), 9 deletions(-)
233933
233933
diff --git a/geo-replication/syncdaemon/master.py b/geo-replication/syncdaemon/master.py
233933
index 42c86d7..3f98337 100644
233933
--- a/geo-replication/syncdaemon/master.py
233933
+++ b/geo-replication/syncdaemon/master.py
233933
@@ -811,7 +811,7 @@ class GMasterChangelogMixin(GMasterCommon):
233933
                 st = lstat(os.path.join(pfx, slave_gfid))
233933
                 # Takes care of scenarios with no hardlinks
233933
                 if isinstance(st, int) and st == ENOENT:
233933
-                    logging.info(lf('Entry not present on master. Fixing gfid '
233933
+                    logging.debug(lf('Entry not present on master. Fixing gfid '
233933
                                     'mismatch in slave. Deleting the entry',
233933
                                     retry_count=retry_count,
233933
                                     entry=repr(failure)))
233933
@@ -843,7 +843,7 @@ class GMasterChangelogMixin(GMasterCommon):
233933
                     if matching_disk_gfid(slave_gfid, pbname):
233933
                         # Safe to ignore the failure as master contains same
233933
                         # file with same gfid. Remove entry from entries list
233933
-                        logging.info(lf('Fixing gfid mismatch in slave. '
233933
+                        logging.debug(lf('Fixing gfid mismatch in slave. '
233933
                                         ' Safe to ignore, take out entry',
233933
                                         retry_count=retry_count,
233933
                                         entry=repr(failure)))
233933
@@ -865,14 +865,14 @@ class GMasterChangelogMixin(GMasterCommon):
233933
                         dst_entry = os.path.join(pfx, realpath.split('/')[-2],
233933
                                                  realpath.split('/')[-1])
233933
                         src_entry = pbname
233933
-                        logging.info(lf('Fixing dir name/gfid mismatch in '
233933
+                        logging.debug(lf('Fixing dir name/gfid mismatch in '
233933
                                         'slave', retry_count=retry_count,
233933
                                         entry=repr(failure)))
233933
                         if src_entry == dst_entry:
233933
                             # Safe to ignore the failure as master contains
233933
                             # same directory as in slave with same gfid.
233933
                             # Remove the failure entry from entries list
233933
-                            logging.info(lf('Fixing dir name/gfid mismatch'
233933
+                            logging.debug(lf('Fixing dir name/gfid mismatch'
233933
                                             ' in slave. Safe to ignore, '
233933
                                             'take out entry',
233933
                                             retry_count=retry_count,
233933
@@ -886,7 +886,7 @@ class GMasterChangelogMixin(GMasterCommon):
233933
                                                entry=src_entry,
233933
                                                entry1=dst_entry, stat=st,
233933
                                                link=None)
233933
-                            logging.info(lf('Fixing dir name/gfid mismatch'
233933
+                            logging.debug(lf('Fixing dir name/gfid mismatch'
233933
                                             ' in slave. Renaming',
233933
                                             retry_count=retry_count,
233933
                                             entry=repr(rename_dict)))
233933
@@ -896,7 +896,7 @@ class GMasterChangelogMixin(GMasterCommon):
233933
                         # renamed file exists and we are sure from
233933
                         # matching_disk_gfid check that the entry doesn't
233933
                         # exist with same gfid so we can safely delete on slave
233933
-                        logging.info(lf('Fixing file gfid mismatch in slave. '
233933
+                        logging.debug(lf('Fixing file gfid mismatch in slave. '
233933
                                         'Hardlink/Rename Case. Deleting entry',
233933
                                         retry_count=retry_count,
233933
                                         entry=repr(failure)))
233933
@@ -915,7 +915,7 @@ class GMasterChangelogMixin(GMasterCommon):
233933
                 # Safe to ignore the failure as master doesn't contain
233933
                 # parent directory.
233933
                 if isinstance(st, int):
233933
-                    logging.info(lf('Fixing ENOENT error in slave. Parent '
233933
+                    logging.debug(lf('Fixing ENOENT error in slave. Parent '
233933
                                     'does not exist on master. Safe to '
233933
                                     'ignore, take out entry',
233933
                                     retry_count=retry_count,
233933
@@ -925,7 +925,7 @@ class GMasterChangelogMixin(GMasterCommon):
233933
                     except ValueError:
233933
                         pass
233933
                 else:
233933
-                    logging.info(lf('Fixing ENOENT error in slave. Create '
233933
+                    logging.debug(lf('Fixing ENOENT error in slave. Create '
233933
                                     'parent directory on slave.',
233933
                                     retry_count=retry_count,
233933
                                     entry=repr(failure)))
233933
@@ -1223,10 +1223,13 @@ class GMasterChangelogMixin(GMasterCommon):
233933
 
233933
             if gconf.get("gfid-conflict-resolution"):
233933
                 count = 0
233933
+                if failures:
233933
+                    logging.info(lf('Entry ops failed with gfid mismatch',
233933
+                                count=len(failures)))
233933
                 while failures and count < self.MAX_OE_RETRIES:
233933
                     count += 1
233933
                     self.handle_entry_failures(failures, entries)
233933
-                    logging.info("Retry original entries. count = %s" % count)
233933
+                    logging.info(lf('Retry original entries', count=count))
233933
                     failures = self.slave.server.entry_ops(entries)
233933
                     if not failures:
233933
                         logging.info("Successfully fixed all entry ops with "
233933
-- 
233933
1.8.3.1
233933