summaryrefslogtreecommitdiff
path: root/source3/lib/dbwrap
AgeCommit message (Collapse)AuthorFilesLines
2012-04-05build: Remove sys_lseek wrapperAndrew Bartlett1-2/+2
2012-04-05build: Remove sys_ftruncate wrapperAndrew Bartlett1-2/+2
2012-04-03s3: Enhance the dbwrap needed x attempts msgVolker Lendecke1-1/+5
Autobuild-User: Volker Lendecke <vl@samba.org> Autobuild-Date: Tue Apr 3 15:17:11 CEST 2012 on sn-devel-104
2012-03-30s3: Avoid a crash with debug level 10Volker Lendecke1-1/+2
Autobuild-User: Volker Lendecke <vl@samba.org> Autobuild-Date: Fri Mar 30 16:52:16 CEST 2012 on sn-devel-104
2012-03-16s3-dbwrap: Move "lock_order" initialization to db_open_xxVolker Lendecke4-6/+8
2012-03-10tdb_wrap: Move to specific directory.Jelmer Vernooij2-2/+2
It's a bit confusing to mix low-level and high-level libraries. We had multiple libraries in one directory, and there were have circular dependencies with other libraries outside that directory (in this case, samba-hostconfig). Autobuild-User: Jelmer Vernooij <jelmer@samba.org> Autobuild-Date: Sat Mar 10 23:13:01 CET 2012 on sn-devel-104
2012-03-05s3-ctdb: Enable CTDB readonly support only if CTDB supports itAmitay Isaacs1-0/+4
Autobuild-User: Amitay Isaacs <amitay@samba.org> Autobuild-Date: Mon Mar 5 02:47:36 CET 2012 on sn-devel-104
2012-03-05dbwrap_ctdb: only fetch a read-only copy if we had a record already.Rusty Russell1-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>
2012-03-05dbwrap_ctdb: handle read-only records.Rusty Russell1-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>
2012-02-27dbwrap: changed log level for information about lock orderAndrew Tridgell1-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
2012-01-18s3: Use lock_order for setting the db priorityVolker Lendecke1-0/+18
Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Wed Jan 18 16:21:52 CET 2012 on sn-devel-104
2012-01-18s3: Pass down lock_order to db_open_ctdbVolker Lendecke3-4/+10
2012-01-18s3: Enforce a lock order in dbwrapVolker Lendecke4-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.
2012-01-18s3: Add a "lock_order" argument to db_openVolker Lendecke3-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.
2012-01-05s3: Fix some nonempty blank linesVolker Lendecke1-3/+3
2011-12-16s3:dbwrap fix return value of db_tdb_parseChristian Ambach1-1/+5
use the TDB ecode to determine the NTSTATUS return value and not the return code that is just -1
2011-12-15s3-dbwrap: All relevant backends provide parse_record(). Remove the fallback.Volker Lendecke1-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
2011-12-15s3-dbwrap: Remove the "fetch" db_context callbackVolker Lendecke5-113/+0
Signed-off-by: Michael Adam <obnox@samba.org>
2011-12-15s3-dbwrap: Rewrite dbwrap_fetch in terms of dbwrap_parse_recordVolker Lendecke1-3/+30
Signed-off-by: Michael Adam <obnox@samba.org>
2011-12-15s3-dbwrap: Rewrite dbwrap_fallback_parse_record based on dbwrap_fetch_lockedVolker Lendecke1-4/+13
This is in preparation to remove the db_context->fetch function pointer Signed-off-by: Michael Adam <obnox@samba.org>
2011-12-15s3-dbwrap: For nostalgic reasons, make dbwrap_file.c compile at leastVolker Lendecke1-9/+14
Signed-off-by: Michael Adam <obnox@samba.org>
2011-12-15s3-dbwrap: Fix some blank line endingsVolker Lendecke1-5/+5
Signed-off-by: Michael Adam <obnox@samba.org>
2011-12-15s3-dbwrap: Implement db_ctdb_parse_record in terms of db_ctdb_fetchVolker Lendecke1-0/+19
Signed-off-by: Michael Adam <obnox@samba.org>
2011-12-15s3-dbwrap: Make dbwrap_parse_record return NTSTATUSVolker Lendecke5-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>
2011-12-13s3-dbwrap: Simplify db_tdb_fetchlock_parse a bitVolker Lendecke1-10/+11
Introduce a local variable for the result, replace "state->result" by "result"
2011-12-09s3-dbwrap: Fix a typoVolker Lendecke1-1/+1
Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Fri Dec 9 13:37:51 CET 2011 on sn-devel-104
2011-12-08s3-dbwrap: & is not required when taking a function pointerVolker Lendecke1-1/+1
Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Thu Dec 8 16:39:29 CET 2011 on sn-devel-104
2011-12-08s3-dbwrap: Make dbwrap_fallback_wipe privateVolker Lendecke3-8/+4
2011-12-08s3-dbwrap: Avoid an "else" by an early returnVolker Lendecke1-4/+4
2011-12-08s3-dbwrap: Make dbwrap_fallback_parse_record privateVolker Lendecke3-14/+5
We have the private fallback in dbwrap_parse_record anyway
2011-12-08s3-dbwrap: Make dbwrap_fallback_fetch privateVolker Lendecke3-10/+6
2011-12-08s3-dbwrap: use wrappers where appropriateVolker Lendecke1-7/+7
2011-12-08s3-dbwrap: Use simpler code for logging keysVolker Lendecke1-18/+23
2011-12-08s3: Fix some blank line endingsVolker Lendecke3-11/+11
2011-12-02s3: Fix some nonblank line endingsVolker Lendecke1-4/+4
Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Fri Dec 2 20:39:33 CET 2011 on sn-devel-104
2011-12-02s3: Remove unused dbwrap_record_get_private_dataVolker Lendecke2-6/+0
db_record->private_data is for backends which can include dbwrap_private.h anyway.
2011-11-30s3:dbwrap_tdb: pass NTSTATUS code further up from db_tdb_fetch_parse in ↵Michael Adam1-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
2011-11-29s3:dbwrap: turn the fetch dbwrap method to NTSTATUS return code.Michael Adam5-55/+58
This implement more correct NTSTATUS handling inside the backends. This ensures that data.dptr != NULL if return code is NT_STATUS_OK.
2011-11-29s3:dbwrap_ctdb: re-use map_nt_error_from_tdb() in local tdb_error_to_ntstatus()Michael Adam1-14/+1
2011-11-25s3:dbwrap: do not burden the user of db_open_ctdb with ifdef voodooGregor Beck2-3/+13
Signed-off-by: Michael Adam <obnox@samba.org>
2011-10-14s3:dbwrap_ctdb: return the number of records in db_ctdb_traverse() for ↵Stefan Metzmacher1-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
2011-10-13s3:dbwrap_ctdb: fix the build after changing signature of tdb_wrap_open()Michael Adam1-1/+7
Autobuild-User: Michael Adam <obnox@samba.org> Autobuild-Date: Thu Oct 13 18:50:47 CEST 2011 on sn-devel-104
2011-10-13lib/util: Add back control of mmap and hash size in tdb for top level buildAndrew Bartlett1-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
2011-10-12s3:dbwrap_ctdb: improve the check for skipping the __db_sequence_number__ ↵Michael Adam1-2/+1
record in traverse It did not compare the last charcter (usually '\0')
2011-10-12s3:dbwrap_ctdb: fix check for skipping the __db_sequence_number__ in traverseMichael Adam1-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...
2011-10-12s3-dbwrap_ctdb: fix the build.Günther Deschner1-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
2011-10-12s3:dbwrap: remove m_all marshall buffer from ctdb transaction.Gregor Beck1-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
2011-10-12s3:dbwrap: traverse records created within this transaction.Gregor Beck1-1/+39
Signed-off-by: Michael Adam <obnox@samba.org>
2011-10-11s3:dbwrap: change dbwrap_store_uint32() to NTSTATUS return typeMichael Adam2-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
2011-10-11s3:dbwrap: change dbwrap_store_int32() to NTSTATUS return typeMichael Adam2-4/+6
for consistency and better error propagation