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