887953
From afff5f5aaab363afebb8fd359af2b8403b992930 Mon Sep 17 00:00:00 2001
887953
From: Ashish Pandey <aspandey@redhat.com>
887953
Date: Thu, 6 Sep 2018 11:20:32 +0530
887953
Subject: [PATCH 447/450] cluster/ec: Don't update trusted.ec.version if fop
887953
 succeeds
887953
887953
If a fop has succeeded on all the bricks and trying to release
887953
the lock, there is no need to update the version for the
887953
file/entry. All it will do is to increase the version from
887953
x to x+1 on all the bricks.
887953
887953
If this update (x to x+1) fails on some brick, this will indicate
887953
that the entry is unhealthy while in realty everything is fine
887953
with the entry.
887953
887953
Avoiding this update will help to not to send one xattrop
887953
at the end of the fops. Which will decrease the chances
887953
of entries being in unhealthy state and also improve the
887953
performance.
887953
887953
upstream patch : https://review.gluster.org/#/c/glusterfs/+/21105
887953
887953
Change-Id: Id9fca6bd2991425db6ed7d1f36af27027accb636
887953
BUG: 1626350
887953
Signed-off-by: Ashish Pandey <aspandey@redhat.com>
887953
Reviewed-on: https://code.engineering.redhat.com/gerrit/156342
887953
Tested-by: RHGS Build Bot <nigelb@redhat.com>
887953
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
887953
---
887953
 xlators/cluster/ec/src/ec-common.c | 9 +++++++++
887953
 1 file changed, 9 insertions(+)
887953
887953
diff --git a/xlators/cluster/ec/src/ec-common.c b/xlators/cluster/ec/src/ec-common.c
887953
index 6d0eb62..a7a8234 100644
887953
--- a/xlators/cluster/ec/src/ec-common.c
887953
+++ b/xlators/cluster/ec/src/ec-common.c
887953
@@ -2372,6 +2372,15 @@ ec_update_info(ec_lock_link_t *link)
887953
                     if (ctx->dirty[1] != 0) {
887953
                         dirty[1] = -1;
887953
                     }
887953
+                    /*If everything is fine and we already
887953
+                     *have version xattr set on entry, there
887953
+                     *is no need to update version again*/
887953
+                    if (ctx->pre_version[0]) {
887953
+                        version[0] = 0;
887953
+                    }
887953
+                    if (ctx->pre_version[1]) {
887953
+                        version[1] = 0;
887953
+                    }
887953
             } else {
887953
                     link->optimistic_changelog = _gf_false;
887953
                     ec_set_dirty_flag (link, ctx, dirty);
887953
-- 
887953
1.8.3.1
887953