summaryrefslogtreecommitdiffstats
path: root/ctdb/server/ctdb_lock.c
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2013-11-18 15:48:22 +1100
committerMichael Adam <obnox@samba.org>2013-11-27 18:46:16 +0100
commit3879e9991f51638290006cf9382c6c487b2f191a (patch)
tree860d3847616a82cbb75f2445e6b7002239f49c59 /ctdb/server/ctdb_lock.c
parent094f34e9bff0ea0499d18a829125b75344bbf65f (diff)
downloadsamba-3879e9991f51638290006cf9382c6c487b2f191a.tar.gz
samba-3879e9991f51638290006cf9382c6c487b2f191a.tar.xz
samba-3879e9991f51638290006cf9382c6c487b2f191a.zip
ctdb-locking: Do not merge multiple lock requests to avoid unfair scheduling
Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'ctdb/server/ctdb_lock.c')
-rw-r--r--ctdb/server/ctdb_lock.c7
1 files changed, 6 insertions, 1 deletions
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) {