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