1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

13 Commits

Author SHA1 Message Date
Volker Lendecke
94cf5cc284 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.
2012-04-17 10:21:00 +02:00
Volker Lendecke
333c92384b s3: Enforce a lock order in dbwrap
This makes sure we do not deadlock from doing two dbwrap_fetch_locked in two
processes in different orders. At open time, we assign a strict order to all
databases. lock_order 1 will be locked first, lock_order 2 second. No two
records of the same lock order may be locked at the same time.
2012-01-18 14:48:04 +01:00
Volker Lendecke
f6d8f7440c s3-dbwrap: Remove the "fetch" db_context callback
Signed-off-by: Michael Adam <obnox@samba.org>
2011-12-15 16:00:47 +01:00
Volker Lendecke
26fc72921f s3-dbwrap: Make dbwrap_parse_record return NTSTATUS
Also, the parser now returns void. The parser is called if and only if
dbwrap_parse_record returns NT_STATUS_OK.

Signed-off-by: Michael Adam <obnox@samba.org>
2011-12-15 16:00:45 +01:00
Michael Adam
efb993b686 s3:dbwrap: turn the fetch dbwrap method to NTSTATUS return code.
This implement more correct NTSTATUS handling inside the backends.
This ensures that data.dptr != NULL if return code is NT_STATUS_OK.
2011-11-29 18:20:06 +01:00
Michael Adam
8750e3f22c s3:dbwrap: move definitions of db_record and db_contect structs to dbwrap_private.h
The API and callers now only need the forward declarations.
2011-10-11 14:17:58 +02:00
Gregor Beck
7b9bf28514 s3:dbwrap: fix db_rbt_traverse() to return the record count on success
this makes it consistent with documented behaviour of tdb_traverse()

Signed-off-by: Michael Adam <obnox@samba.org>
2011-10-11 14:17:56 +02:00
Gregor Beck
ebcb921182 s3:dbwrap: add specific dbwrap_wipe() implementation to dbwrap_rbt
Signed-off-by: Michael Adam <obnox@samba.org>
2011-10-11 14:17:56 +02:00
Gregor Beck
63c5c0eccf s3:dbwrap: add specific dbwrap_parse_record() implementation to dbwrap_rbt
Signed-off-by: Michael Adam <obnox@samba.org>
2011-10-11 14:17:55 +02:00
Gregor Beck
fff09d066f s3:dbwrap: add specific dbwrap_exists() implementation to dbwrap_rbt 2011-10-11 14:17:55 +02:00
Gregor Beck
28e4c41d5b s3:dbwrap: factor out db_rpt_search_internal()
Signed-off-by: Michael Adam <obnox@samba.org>
2011-10-11 14:17:55 +02:00
Michael Adam
7a72c84ee7 s3:dbwrap: move the db_open_rbt() prototype to a new header dbwrap_rbt.h 2011-10-11 14:17:55 +02:00
Michael Adam
0b5c4a601a s3:dbwrap: move all .c and .h files of dbwrap to lib/dbwrap/
Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Fri Jul 29 13:34:22 CEST 2011 on sn-devel-104
2011-07-29 13:34:22 +02:00