From 3879e9991f51638290006cf9382c6c487b2f191a Mon Sep 17 00:00:00 2001 From: Amitay Isaacs Date: Mon, 18 Nov 2013 15:48:22 +1100 Subject: [PATCH] ctdb-locking: Do not merge multiple lock requests to avoid unfair scheduling Signed-off-by: Amitay Isaacs Reviewed-by: Michael Adam --- ctdb/server/ctdb_lock.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ctdb/server/ctdb_lock.c b/ctdb/server/ctdb_lock.c index 23be5f52e4c..1c333966060 100644 --- a/ctdb/server/ctdb_lock.c +++ b/ctdb/server/ctdb_lock.c @@ -893,7 +893,7 @@ static struct lock_request *ctdb_lock_internal(struct ctdb_context *ctdb, enum lock_type type, bool auto_mark) { - struct lock_context *lock_ctx; + struct lock_context *lock_ctx = NULL; struct lock_request *request; if (callback == NULL) { @@ -901,9 +901,14 @@ static struct lock_request *ctdb_lock_internal(struct ctdb_context *ctdb, return NULL; } +#if 0 + /* Disable this optimization to ensure first-in-first-out fair + * scheduling of lock requests */ + /* get a context for this key - search only the pending contexts, * current contexts might in the middle of processing callbacks */ lock_ctx = find_lock_context(ctdb->lock_pending, ctdb_db, key, priority, type); +#endif /* No existing context, create one */ if (lock_ctx == NULL) { -- 2.11.4.GIT