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