From: Andrew Tridgell Date: Mon, 16 Apr 2007 23:18:20 +0000 (+1000) Subject: add an explanation of ctdb_ltdb_lock_fetch_requeue() X-Git-Tag: tevent-0.9.20~348^2~2911 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=71bf837a1939f765419359a6bca5996d54fc662a;p=thirdparty%2Fsamba.git add an explanation of ctdb_ltdb_lock_fetch_requeue() (This used to be ctdb commit 7c749315130a2bc87dcc07460d10dcb089ae4202) --- diff --git a/ctdb/common/ctdb_ltdb.c b/ctdb/common/ctdb_ltdb.c index b18f2674807..132108e69b1 100644 --- a/ctdb/common/ctdb_ltdb.c +++ b/ctdb/common/ctdb_ltdb.c @@ -229,6 +229,21 @@ static void lock_fetch_callback(void *p) /* do a non-blocking ltdb_fetch with a locked record, deferring this ctdb request until we have the chainlock + + It does the following: + + 1) tries to get the chainlock. If it succeeds, then it fetches the record, and + returns 0 + + 2) if it fails to get a chainlock immediately then it sets up a + non-blocking chainlock via ctdb_lockwait, and when it gets the + chainlock it re-submits this ctdb request to the main packet + receive function + + This effectively queues all ctdb requests that cannot be + immediately satisfied until it can get the lock. This means that + the main ctdb daemon will not block waiting for a chainlock held by + a client */ int ctdb_ltdb_lock_fetch_requeue(struct ctdb_db_context *ctdb_db, TDB_DATA key, struct ctdb_ltdb_header *header,