summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2007-04-17 09:18:20 +1000
committerAndrew Tridgell <tridge@samba.org>2007-04-17 09:18:20 +1000
commit71bf837a1939f765419359a6bca5996d54fc662a (patch)
tree8f04e127da9546f130a77026ec7424b141697002
parenta024989597444aabc3a44da99c5e6828236cba3f (diff)
downloadsamba-71bf837a1939f765419359a6bca5996d54fc662a.tar.gz
samba-71bf837a1939f765419359a6bca5996d54fc662a.tar.xz
samba-71bf837a1939f765419359a6bca5996d54fc662a.zip
add an explanation of ctdb_ltdb_lock_fetch_requeue()
(This used to be ctdb commit 7c749315130a2bc87dcc07460d10dcb089ae4202)
-rw-r--r--ctdb/common/ctdb_ltdb.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/ctdb/common/ctdb_ltdb.c b/ctdb/common/ctdb_ltdb.c
index b18f267480..132108e69b 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,