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