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