From 3d34c495d547866a533bc0614b14163381830095 Mon Sep 17 00:00:00 2001 From: Ashish Pandey Date: Wed, 17 Feb 2016 15:57:02 +0530 Subject: 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 Reviewed-on: http://review.gluster.org/13849 Smoke: Gluster Build System CentOS-regression: Gluster Build System NetBSD-regression: NetBSD Build System Reviewed-by: Pranith Kumar Karampuri --- libglusterfs/src/glfs-message-id.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'libglusterfs') diff --git a/libglusterfs/src/glfs-message-id.h b/libglusterfs/src/glfs-message-id.h index e1b75400bbd..b022ca591ec 100644 --- a/libglusterfs/src/glfs-message-id.h +++ b/libglusterfs/src/glfs-message-id.h @@ -162,6 +162,13 @@ GLFS_MSGID_COMP_SYMLINK_CACHE_END #define GLFS_MSGID_COMP_SHARD GLFS_MSGID_COMP_CHANGELOG_LIB_END #define GLFS_MSGID_COMP_SHARD_END (GLFS_MSGID_COMP_SHARD +\ GLFS_MSGID_SEGMENT) -/* --- new segments for messages goes above this line --- */ + +#define GLFS_MSGID_COMP_NSR GLFS_MSGID_COMP_SHARD_END +#define GLFS_MSGID_COMP_NSR_END (GLFS_MSGID_COMP_SHARD_END+\ + GLFS_MSGID_SEGMENT) + +#define GLFS_MSGID_COMP_PL GLFS_MSGID_COMP_NSR_END +#define GLFS_MSGID_COMP_PL_END (GLFS_MSGID_COMP_PL +\ + GLFS_MSGID_SEGMENT) #endif /* !_GLFS_MESSAGE_ID_H_ */ -- cgit