]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
add an explanation of ctdb_ltdb_lock_fetch_requeue()
authorAndrew Tridgell <tridge@samba.org>
Mon, 16 Apr 2007 23:18:20 +0000 (09:18 +1000)
committerAndrew Tridgell <tridge@samba.org>
Mon, 16 Apr 2007 23:18:20 +0000 (09:18 +1000)
(This used to be ctdb commit 7c749315130a2bc87dcc07460d10dcb089ae4202)

ctdb/common/ctdb_ltdb.c

index b18f26748076b53392506d28a4fabc8517a37328..132108e69b187172b86c99d8a8a3f2234875bba0 100644 (file)
@@ -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,