From 527dffeb699e5ac857a798d462a3fba4aed3c5a5 Mon Sep 17 00:00:00 2001 From: Ashish Pandey Date: Thu, 6 Sep 2018 11:20:32 +0530 Subject: 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 --- xlators/cluster/ec/src/ec-common.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'xlators/cluster/ec') 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); -- cgit