s3: Add dbwrap_try_fetch_locked
commit94cf5cc284ba908675ed5fd573dd101d7b9bad02
authorVolker Lendecke <vl@samba.org>
Tue, 27 Mar 2012 12:31:04 +0000 (27 14:31 +0200)
committerVolker Lendecke <vl@samba.org>
Tue, 17 Apr 2012 08:21:00 +0000 (17 10:21 +0200)
treefa3cbe066f5400c31cfa13ea149e13bada59fbdc
parentbd9178506ed8796a0aa7e4e757f2adc20dcae4f8
s3: Add dbwrap_try_fetch_locked

This is designed to spread the load on individual ctdb records to allow upper
layers to do backoff mechanisms. In the ctdb case, do not get the record if a
local lock is already taken. If we are not dmaster, do at most one migrate
attempt.

For the tdb case, this is a nonblocking fetch_locked. If someone else has the
lock, give up.
source3/lib/dbwrap/dbwrap.c
source3/lib/dbwrap/dbwrap.h
source3/lib/dbwrap/dbwrap_cache.c
source3/lib/dbwrap/dbwrap_ctdb.c
source3/lib/dbwrap/dbwrap_file.c
source3/lib/dbwrap/dbwrap_private.h
source3/lib/dbwrap/dbwrap_rbt.c
source3/lib/dbwrap/dbwrap_tdb.c