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