summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAshish Pandey <aspandey@redhat.com>2018-09-06 11:20:32 +0530
committerXavi Hernandez <xhernandez@redhat.com>2018-09-07 07:29:39 +0000
commit527dffeb699e5ac857a798d462a3fba4aed3c5a5 (patch)
tree2cad360f66357051a3b971fad85f431b1b65afcf
parent18543fec0da8d0459501fb96f8efb019190bf223 (diff)
cluster/ec: Don't update trusted.ec.version if fop succeeds
If a fop has succeeded on all the bricks and trying to release the lock, there is no need to update the version for the file/entry. All it will do is to increase the version from x to x+1 on all the bricks. If this update (x to x+1) fails on some brick, this will indicate that the entry is unhealthy while in realty everything is fine with the entry. Avoiding this update will help to not to send one xattrop at the end of the fops. Which will decrease the chances of entries being in unhealthy state and also improve the performance. Change-Id: Id9fca6bd2991425db6ed7d1f36af27027accb636 fixes: bz#1623759 Signed-off-by: Ashish Pandey <aspandey@redhat.com>
-rw-r--r--xlators/cluster/ec/src/ec-common.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/xlators/cluster/ec/src/ec-common.c b/xlators/cluster/ec/src/ec-common.c
index 63029e9f11b..86432bd7da7 100644
--- a/xlators/cluster/ec/src/ec-common.c
+++ b/xlators/cluster/ec/src/ec-common.c
@@ -2416,6 +2416,15 @@ ec_update_info(ec_lock_link_t *link)
if (ctx->dirty[1] != 0) {
dirty[1] = -1;
}
+ /*If everything is fine and we already
+ *have version xattr set on entry, there
+ *is no need to update version again*/
+ if (ctx->pre_version[0]) {
+ version[0] = 0;
+ }
+ if (ctx->pre_version[1]) {
+ version[1] = 0;
+ }
} else {
link->optimistic_changelog = _gf_false;
ec_set_dirty_flag (link, ctx, dirty);