diff options
author | Ashish Pandey <aspandey@redhat.com> | 2016-02-17 15:57:02 +0530 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2016-03-31 05:45:50 -0700 |
commit | 3d34c495d547866a533bc0614b14163381830095 (patch) | |
tree | 1e14b7944f4d42aa899ede893b86d725f81af489 /xlators/features/locks/src/entrylk.c | |
parent | 4f2b417f0a6fea20c8a96b6f66732c709234d637 (diff) |
cluster/ec: Rebalance hangs during rename
Problem:
During the rename of a particular file (ec
is holding blocking inodelk on the parent
directory), if the rename of another file
under the same directory comes. EC does not
release the lock and goes ahead and renames
the "new" file with the "already held lock".
That causes rebalance process to be blocked
on a lock which has been acquired by rename.
Solution:
While rename fop comes, ec takes blocking inodelk
on old and new parent of the file. Before releasing,
every lock held by ec, it waits for some "time" to
see if that lock can be reused by the next fop.
If within this "time" some other request comes,
it releases this lock based on condition
"lock count > 1"
To get this "lock count" for rename fop, we have
implemented "pl_rename" in feature/lock. Also,
on ec side, changed the condition to release the lock
based on the type of fop and old and new parent
directories.
master-
http://review.gluster.org/#/c/13460/
Change-Id: I979dbab1185df962e8f305a6074ae1186ffe7db0
Bug: 1322299
Signed-off-by: Ashish Pandey <aspandey@redhat.com>
Reviewed-on: http://review.gluster.org/13849
Smoke: Gluster Build System <jenkins@build.gluster.com>
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'xlators/features/locks/src/entrylk.c')
-rw-r--r-- | xlators/features/locks/src/entrylk.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/xlators/features/locks/src/entrylk.c b/xlators/features/locks/src/entrylk.c index a4b5969a189..d039db6d5a4 100644 --- a/xlators/features/locks/src/entrylk.c +++ b/xlators/features/locks/src/entrylk.c @@ -437,10 +437,10 @@ __unlock_entrylk (pl_dom_list_t *dom, pl_entry_lock_t *lock) return ret_lock; } -uint32_t +int32_t check_entrylk_on_basename (xlator_t *this, inode_t *parent, char *basename) { - uint32_t entrylk = 0; + int32_t entrylk = 0; pl_inode_t *pinode = 0; pl_dom_list_t *dom = NULL; pl_entry_lock_t *conf = NULL; |