From 94cf5cc284ba908675ed5fd573dd101d7b9bad02 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 27 Mar 2012 14:31:04 +0200 Subject: 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.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/lib/dbwrap/dbwrap.h') diff --git a/source3/lib/dbwrap/dbwrap.h b/source3/lib/dbwrap/dbwrap.h index 386a9fa2a4..9981b6dfd9 100644 --- a/source3/lib/dbwrap/dbwrap.h +++ b/source3/lib/dbwrap/dbwrap.h @@ -34,6 +34,9 @@ NTSTATUS dbwrap_record_delete(struct db_record *rec); struct db_record *dbwrap_fetch_locked(struct db_context *db, TALLOC_CTX *mem_ctx, TDB_DATA key); +struct db_record *dbwrap_try_fetch_locked(struct db_context *db, + TALLOC_CTX *mem_ctx, + TDB_DATA key); NTSTATUS dbwrap_delete(struct db_context *db, TDB_DATA key); NTSTATUS dbwrap_store(struct db_context *db, TDB_DATA key, -- cgit