summaryrefslogtreecommitdiffstats
path: root/source3/lib/dbwrap
Commit message (Collapse)AuthorAgeFilesLines
...
* s3-ctdb: Enable CTDB readonly support only if CTDB supports itAmitay Isaacs2012-03-051-0/+4
| | | | | Autobuild-User: Amitay Isaacs <amitay@samba.org> Autobuild-Date: Mon Mar 5 02:47:36 CET 2012 on sn-devel-104
* dbwrap_ctdb: only fetch a read-only copy if we had a record already.Rusty Russell2012-03-051-2/+7
| | | | | | | | | | | | | Because revoking read-only copies of records is expensive, we only want ctdbd to do it for high-turnover records. A basic heuristic is that if we don't find a local copy of the record, don't ask for a read-only copy. The fetch itself will cause ctdbd to migrate the record, so eventually we will have a local copy. Next time it gets migrated away, we'll call ctdbd_fetch() with local_copy = true. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* dbwrap_ctdb: handle read-only records.Rusty Russell2012-03-051-9/+26
| | | | | | | | | | | | | | | | | | | | | The new read-only record flags make determining if we can use a record a bit more complex, so extract it into its own function. The OLD logic was: 1) If the record doesn't exist, we can't use it. 2) If we are the dmaster for the record, we can use it. The new logic is: 1) If the record doesn't exist, we can't use it. 2) If we are the dmaster for the record, we can use it IF we only want read-only access, OR there are no read-only delegations. 3) If we are not dmaster, we can only use it if we want read-only access and it is marked as a read-only copy. This logic is unused until the next patches which begin to ask for read-only copies of records. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* dbwrap: changed log level for information about lock orderAndrew Tridgell2012-02-271-1/+1
| | | | | | | | | we were filling our logs with lock ordering debug lines Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org> Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Mon Feb 27 12:50:29 CET 2012 on sn-devel-104
* s3: Use lock_order for setting the db priorityVolker Lendecke2012-01-181-0/+18
| | | | | Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Wed Jan 18 16:21:52 CET 2012 on sn-devel-104
* s3: Pass down lock_order to db_open_ctdbVolker Lendecke2012-01-183-4/+10
|
* s3: Enforce a lock order in dbwrapVolker Lendecke2012-01-184-1/+85
| | | | | | | 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.
* s3: Add a "lock_order" argument to db_openVolker Lendecke2012-01-183-3/+26
| | | | | | | This will be used to enforce a lock hierarchy between the databases. We have seen deadlocks between locking.tdb, brlock.tdb, serverid.tdb and notify*.tdb. These should be fixed by refusing a dbwrap_fetch_locked that does not follow a defined lock hierarchy.
* s3: Fix some nonempty blank linesVolker Lendecke2012-01-051-3/+3
|
* s3:dbwrap fix return value of db_tdb_parseChristian Ambach2011-12-161-1/+5
| | | | | use the TDB ecode to determine the NTSTATUS return value and not the return code that is just -1
* s3-dbwrap: All relevant backends provide parse_record(). Remove the fallback.Volker Lendecke2011-12-151-37/+0
| | | | | | | Signed-off-by: Michael Adam <obnox@samba.org> Autobuild-User: Michael Adam <obnox@samba.org> Autobuild-Date: Thu Dec 15 17:41:53 CET 2011 on sn-devel-104
* s3-dbwrap: Remove the "fetch" db_context callbackVolker Lendecke2011-12-155-113/+0
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* s3-dbwrap: Rewrite dbwrap_fetch in terms of dbwrap_parse_recordVolker Lendecke2011-12-151-3/+30
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* s3-dbwrap: Rewrite dbwrap_fallback_parse_record based on dbwrap_fetch_lockedVolker Lendecke2011-12-151-4/+13
| | | | | | This is in preparation to remove the db_context->fetch function pointer Signed-off-by: Michael Adam <obnox@samba.org>
* s3-dbwrap: For nostalgic reasons, make dbwrap_file.c compile at leastVolker Lendecke2011-12-151-9/+14
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* s3-dbwrap: Fix some blank line endingsVolker Lendecke2011-12-151-5/+5
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* s3-dbwrap: Implement db_ctdb_parse_record in terms of db_ctdb_fetchVolker Lendecke2011-12-151-0/+19
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* s3-dbwrap: Make dbwrap_parse_record return NTSTATUSVolker Lendecke2011-12-155-37/+62
| | | | | | | 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>
* s3-dbwrap: Simplify db_tdb_fetchlock_parse a bitVolker Lendecke2011-12-131-10/+11
| | | | Introduce a local variable for the result, replace "state->result" by "result"
* s3-dbwrap: Fix a typoVolker Lendecke2011-12-091-1/+1
| | | | | Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Fri Dec 9 13:37:51 CET 2011 on sn-devel-104
* s3-dbwrap: & is not required when taking a function pointerVolker Lendecke2011-12-081-1/+1
| | | | | Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Thu Dec 8 16:39:29 CET 2011 on sn-devel-104
* s3-dbwrap: Make dbwrap_fallback_wipe privateVolker Lendecke2011-12-083-8/+4
|
* s3-dbwrap: Avoid an "else" by an early returnVolker Lendecke2011-12-081-4/+4
|
* s3-dbwrap: Make dbwrap_fallback_parse_record privateVolker Lendecke2011-12-083-14/+5
| | | | We have the private fallback in dbwrap_parse_record anyway
* s3-dbwrap: Make dbwrap_fallback_fetch privateVolker Lendecke2011-12-083-10/+6
|
* s3-dbwrap: use wrappers where appropriateVolker Lendecke2011-12-081-7/+7
|
* s3-dbwrap: Use simpler code for logging keysVolker Lendecke2011-12-081-18/+23
|
* s3: Fix some blank line endingsVolker Lendecke2011-12-083-11/+11
|
* s3: Fix some nonblank line endingsVolker Lendecke2011-12-021-4/+4
| | | | | Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Fri Dec 2 20:39:33 CET 2011 on sn-devel-104
* s3: Remove unused dbwrap_record_get_private_dataVolker Lendecke2011-12-022-6/+0
| | | | | db_record->private_data is for backends which can include dbwrap_private.h anyway.
* s3:dbwrap_tdb: pass NTSTATUS code further up from db_tdb_fetch_parse in ↵Michael Adam2011-11-301-1/+1
| | | | | | | db_tdb_fetch() Autobuild-User: Michael Adam <obnox@samba.org> Autobuild-Date: Wed Nov 30 01:46:31 CET 2011 on sn-devel-104
* s3:dbwrap: turn the fetch dbwrap method to NTSTATUS return code.Michael Adam2011-11-295-55/+58
| | | | | This implement more correct NTSTATUS handling inside the backends. This ensures that data.dptr != NULL if return code is NT_STATUS_OK.
* s3:dbwrap_ctdb: re-use map_nt_error_from_tdb() in local tdb_error_to_ntstatus()Michael Adam2011-11-291-14/+1
|
* s3:dbwrap: do not burden the user of db_open_ctdb with ifdef voodooGregor Beck2011-11-252-3/+13
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* s3:dbwrap_ctdb: return the number of records in db_ctdb_traverse() for ↵Stefan Metzmacher2011-10-141-3/+15
| | | | | | | | | persistent dbs metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Fri Oct 14 20:59:37 CEST 2011 on sn-devel-104
* s3:dbwrap_ctdb: fix the build after changing signature of tdb_wrap_open()Michael Adam2011-10-131-1/+7
| | | | | Autobuild-User: Michael Adam <obnox@samba.org> Autobuild-Date: Thu Oct 13 18:50:47 CEST 2011 on sn-devel-104
* lib/util: Add back control of mmap and hash size in tdb for top level buildAndrew Bartlett2011-10-131-2/+6
| | | | | | | | This passes down a struct loadparm_context to allow these parameters to be checked. This may be s3 or s4 context, allowing the #if _SAMBA_BUILD_ macro to go away safely. Andrew Bartlett
* s3:dbwrap_ctdb: improve the check for skipping the __db_sequence_number__ ↵Michael Adam2011-10-121-2/+1
| | | | | | record in traverse It did not compare the last charcter (usually '\0')
* s3:dbwrap_ctdb: fix check for skipping the __db_sequence_number__ in traverseMichael Adam2011-10-121-1/+1
| | | | | Brown paperbag. This omitted the "== 0" hand hence skipped all keys of the same length as __db_sequence_number__ but different from it...
* s3-dbwrap_ctdb: fix the build.Günther Deschner2011-10-121-1/+4
| | | | | | | | | Michael, please check. Guenther Autobuild-User: Günther Deschner <gd@samba.org> Autobuild-Date: Wed Oct 12 15:25:56 CEST 2011 on sn-devel-104
* s3:dbwrap: remove m_all marshall buffer from ctdb transaction.Gregor Beck2011-10-121-23/+1
| | | | | | | | | it was only used by ctdb_replay_transaction and was a actually write only Signed-off-by: Michael Adam <obnox@samba.org> Autobuild-User: Michael Adam <obnox@samba.org> Autobuild-Date: Wed Oct 12 05:20:36 CEST 2011 on sn-devel-104
* s3:dbwrap: traverse records created within this transaction.Gregor Beck2011-10-121-1/+39
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* s3:dbwrap: change dbwrap_store_uint32() to NTSTATUS return typeMichael Adam2011-10-112-4/+6
| | | | | | | for consistency and better error propagation Autobuild-User: Michael Adam <obnox@samba.org> Autobuild-Date: Tue Oct 11 15:51:00 CEST 2011 on sn-devel-104
* s3:dbwrap: change dbwrap_store_int32() to NTSTATUS return typeMichael Adam2011-10-112-4/+6
| | | | for consistency and better error propagation
* s3:dbwrap: change dbwrap_fetch_uint32() to NTSTATUS return type (instead of ↵Michael Adam2011-10-112-7/+11
| | | | | | bool) for consistency and better error propagation
* s3:dbwrap: convert dbwrap_fetch_int32() to NTSTATUS return codeMichael Adam2011-10-112-7/+12
| | | | | | Return the int32 value retrieved from the db by reference. Before this, return value "-1" was used as a error indication, but it could also be a valid value from the database.
* s3:dbwrap: move definitions of db_record and db_contect structs to ↵Michael Adam2011-10-115-35/+40
| | | | | | dbwrap_private.h The API and callers now only need the forward declarations.
* s3:dbwrap: convert dbwrap_util.c to use dbwrap wrapper functionsMichael Adam2011-10-111-33/+41
|
* s3:dbwrap: use dbwrap_fetch_bystring() in dbwrap_fetch_[u]int32()Michael Adam2011-10-111-2/+6
|
* s3:dbwrap: convert dbwrap_fetch(), dbwrap_fetch_bystring() and ↵Michael Adam2011-10-113-21/+23
| | | | dbwrap_fetch_bystring_upper() to NTSTATUS