summaryrefslogtreecommitdiffstats
path: root/source3/lib/dbwrap
Commit message (Collapse)AuthorAgeFilesLines
* move the dbwrap library to the top levelMichael Adam2012-05-1414-2812/+2
| | | | | Autobuild-User: Michael Adam <obnox@samba.org> Autobuild-Date: Mon May 14 04:04:55 CEST 2012 on sn-devel-104
* s3:lib:dbwrap: use [u]int[num]_t consistently in dbwrap_tdb.cMichael Adam2012-05-131-1/+1
|
* s3:lib:dbwrap: use [u]int[num]_t consistently in dbwrap_rbt.cMichael Adam2012-05-131-2/+2
|
* s3:lib:dbwrap: use [u]int[num]_t consistently in dbwrap_ctdb.cMichael Adam2012-05-131-6/+8
|
* s3:lib:dbwrap: use [u]int[num]_t consistently in dbwrap_file.cMichael Adam2012-05-131-6/+7
|
* s3:lib:dbwrap: use [u]int[num]_t consistently in dbwrap_util.cMichael Adam2012-05-131-9/+9
|
* s3:dbwrap: move definition of dbwrap_lock_order to dbwrap.hMichael Adam2012-05-134-8/+7
| | | | This is needed in all of the library, not only in the dbwrap_open part.
* s3: Fix Coverity ID 2751: REVERSE_INULLVolker Lendecke2012-04-241-1/+1
|
* s3-dbwrap: A void function can not return a valueAndrew Bartlett2012-04-231-1/+1
| | | | | | | | | Only non-gcc compilers seem to notice this as an error. Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Mon Apr 23 05:58:52 CEST 2012 on sn-devel-104
* s3: Implement db_id for dbwrap_cacheVolker Lendecke2012-04-211-0/+9
| | | | | Autobuild-User: Volker Lendecke <vl@samba.org> Autobuild-Date: Sat Apr 21 13:46:00 CEST 2012 on sn-devel-104
* s3: Initialize "stored_callback" in dbwrap_cacheVolker Lendecke2012-04-211-0/+1
| | | | This should fix one of the recent flaky tests
* s3-dbwrap: dbwrap_watch_record_stored => NT_STATUS_NOT_FOUND is ok...Stefan Metzmacher2012-04-201-0/+3
| | | | | Autobuild-User: Volker Lendecke <vl@samba.org> Autobuild-Date: Fri Apr 20 17:05:52 CEST 2012 on sn-devel-104
* s3-dbwrap: Add dbwrap_record_watch_send/recvVolker Lendecke2012-04-192-0/+529
| | | | With this API you can asynchronously wait for a record to be modified
* s3-dbwrap: Add dbwrap_set_stored_callbackVolker Lendecke2012-04-206-2/+47
| | | | This is a per-db function that is called whenever some record is modified
* s3-dbwrap: Add "db_context" to "db_record"Volker Lendecke2012-04-204-0/+10
|
* s3-dbwrap: Add dbwrap_db_idVolker Lendecke2012-04-206-0/+50
| | | | This returns a blob uniquely identifying the database
* s3: Fix Coverity ID 2744: CHECKED_RETURNVolker Lendecke2012-04-191-1/+6
|
* s3: Fix Coverity ID 2745 and 2746: FORWARD_NULLVolker Lendecke2012-04-191-11/+15
| | | | We can assume that the rbt dbs are around
* s3-dbwrap: Remove dead code: talloc_stackframe() cannot failAndrew Bartlett2012-04-191-10/+1
|
* s3-dbwrap: Fix an unused var warningVolker Lendecke2012-04-181-0/+2
|
* s3-dbwrap: push lp_ctx up another layer in the stackAndrew Bartlett2012-04-183-5/+6
| | | | | | | | | | This will allow db_open_tdb() to be called from common code, which may already have a loadparm context loaded. It also slowly moves the lp_ctx up the stack, as required to remove the library loop between smbconf and the registry. Andrew Bartlett
* s3-dbwrap: Add talloc_stackframe() callsAndrew Bartlett2012-04-181-5/+21
| | | | | | | This is in preperation for calling dbwrap from common code, where we may not have a stackframe set up. Andrew Bartlett
* s3: Add dbwrap_try_fetch_lockedVolker Lendecke2012-04-178-16/+97
| | | | | | | | | | 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.
* s3: Add dbwrap_cacheVolker Lendecke2012-04-172-0/+242
| | | | | | This is a caching layer for the notify database and potentially for the brlock database. It caches the parse_record operation as long as the underlying seqnum does not change.
* s3: Open up 3 levels of dbwrap_lock_orderVolker Lendecke2012-04-172-5/+9
|
* s3: Return CTDB_PATH from lp_ctdbd_socket()Volker Lendecke2012-04-171-8/+0
| | | | All callers had that fallback
* s3: Compile fix for dbwrap_file.cVolker Lendecke2012-04-071-1/+1
| | | | | Autobuild-User: Volker Lendecke <vl@samba.org> Autobuild-Date: Sat Apr 7 14:10:35 CEST 2012 on sn-devel-104
* build: Remove sys_lseek wrapperAndrew Bartlett2012-04-051-2/+2
|
* build: Remove sys_ftruncate wrapperAndrew Bartlett2012-04-051-2/+2
|
* s3: Enhance the dbwrap needed x attempts msgVolker Lendecke2012-04-031-1/+5
| | | | | Autobuild-User: Volker Lendecke <vl@samba.org> Autobuild-Date: Tue Apr 3 15:17:11 CEST 2012 on sn-devel-104
* s3: Avoid a crash with debug level 10Volker Lendecke2012-03-301-1/+2
| | | | | Autobuild-User: Volker Lendecke <vl@samba.org> Autobuild-Date: Fri Mar 30 16:52:16 CEST 2012 on sn-devel-104
* s3-dbwrap: Move "lock_order" initialization to db_open_xxVolker Lendecke2012-03-164-6/+8
|
* tdb_wrap: Move to specific directory.Jelmer Vernooij2012-03-102-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
* 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>