locking: Schedule a new lock request everytime a lock is released
authorAmitay Isaacs <amitay@gmail.com>
Mon, 9 Jul 2012 07:37:35 +0000 (17:37 +1000)
committerAmitay Isaacs <amitay@gmail.com>
Fri, 19 Oct 2012 15:48:44 +0000 (02:48 +1100)
Since the number of active lock requests is limited to
MAX_LOCK_PROCESSES_PER_DB (= 100), any new requests won't get scheduled
when they are created. So schedule a pending request once current active
request is done.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
server/ctdb_lock.c

index 001fad5ae324ae5a88ada3ce2a739c5f91d4f5a5..667c11791c3942dbf8f8ebccfc0c18676549f070 100644 (file)
@@ -318,6 +318,7 @@ void ctdb_unlock_item(struct lock_context *lock_ctx)
        }
 }
 
+static void ctdb_lock_schedule(struct ctdb_context *ctdb);
 
 /*
  * Destructor to kill the child locking process
@@ -340,6 +341,9 @@ static int ctdb_lock_context_destructor(struct lock_context *lock_ctx)
                        CTDB_DECREMENT_DB_STAT(lock_ctx->ctdb_db, locks.num_pending);
                }
        }
+
+       ctdb_lock_schedule(lock_ctx->ctdb);
+
        return 0;
 }