summaryrefslogtreecommitdiff
path: root/source3/lib/dbwrap/dbwrap_ctdb.c
AgeCommit message (Collapse)AuthorFilesLines
2013-03-26dbwrap-ctdb: Avoid a talloc_stackframe()Volker Lendecke1-4/+2
We have only a single allocation in this routine, so I think we can live without a stackframe. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-03-26dbwrap-ctdb: Use ctdbd_parse in db_ctdb_parse_recordVolker Lendecke1-9/+2
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-03-25dbwrap: Use tdb_null in db_ctdb_deleteVolker Lendecke1-4/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Christian Ambach <ambi@samba.org> Autobuild-User(master): Christian Ambach <ambi@samba.org> Autobuild-Date(master): Mon Mar 25 19:42:30 CET 2013 on sn-devel-104
2013-02-04s3:dbrwap_ctdb: ZERO_STRUCT(rec) just to be sure in ↵Michael Adam1-0/+1
traverse_persistent_callback_read() Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-02-04s3:dbwrap_ctdb: ZERO_STRUCT(rec) just to be sure in traverse_read_callback()Michael Adam1-0/+2
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-02-04s3:dbwrap_ctdb: add "db_context" to "db_record"Stefan Metzmacher1-2/+5
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-04s3:dbwrap_ctdb: setup result->name in db_open_ctdb()Stefan Metzmacher1-0/+7
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-29s3: Remove db_ctdb_fetchVolker Lendecke1-55/+11
Note that this also makes the request for read only copies much more explicity visible in the code. Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-29s3: Directly parse local existing records in db_ctdb_parse_recordVolker Lendecke1-0/+22
Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-29s3: Factor out db_ctdb_can_use_local_hdr from db_ctdb_can_use_local_copyVolker Lendecke1-11/+14
Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-29s3: Remove unused code for fetching persistent ctdb recordsVolker Lendecke1-129/+0
The only entry point here is parse_record, and this catches the persistent case with a direct parse now Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-29s3: Avoid db_ctdb_fetch for persistent databasesVolker Lendecke1-0/+44
Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-29s3: Factor out parse_newest_in_marshall_buffer from ↵Volker Lendecke1-15/+51
pull_newest_from_marshall_buffer Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-29s3: reduce db_ctdb_marshall_loop_next to specialized db_ctdb_marshall_buf_parseVolker Lendecke1-48/+21
now that the db_ctdb_marshall_loop_next_key has been factored out. Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-29s3: Factor out db_ctdb_marshall_loop_next_key from db_ctdb_marshall_loop_nextVolker Lendecke1-9/+24
Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-29s3: Slightly simplify db_ctdb_marshall_loop_nextVolker Lendecke1-4/+3
Both callers give a key argument Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-29s3: Use db_ctdb_ltdb_parse in db_ctdb_fetch_db_seqnum_from_dbVolker Lendecke1-20/+21
Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-29s3: Use db_ctdb_ltdb_parse in db_ctdb_ltdb_fetchVolker Lendecke1-30/+46
Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-29s3: Add db_ctdb_ltdb_parseVolker Lendecke1-0/+42
Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-29s3: Slightly simplify db_ctdb_transaction_commitVolker Lendecke1-1/+2
Avoid an unnecessary "else". Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-29s3: Remove header==NULL code from db_ctdb_marshall_recordVolker Lendecke1-12/+5
The only call chain (via db_ctdb_marshall_add) has header != NULL Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-20s3: Fix some blank line endingsVolker Lendecke1-10/+10
Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Tue Nov 20 19:18:33 CET 2012 on sn-devel-104
2012-09-21s3:dbwrap_ctdb: set errno = ENOSYS if clustering is not supportedGregor Beck1-0/+1
Signed-off-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Fri Sep 21 18:05:56 CEST 2012 on sn-devel-104
2012-08-31s3:dbwrap_ctdb: Add DB name and key to warning messageChristof Schmitt1-1/+8
When a operation takes too long, it is useful for debugging to know the DB and the key. Signed-off-by: Christian Ambach <ambi@samba.org>
2012-07-31s3:dbwrap_ctdb: initialize db_record->dbStefan Metzmacher1-0/+1
metze
2012-06-29s3_dbrwap_ctdb: improve a comment in db_ctdb_can_use_local_record()Michael Adam1-1/+3
Pair-Programmed-With: Gregor Beck <gbeck@sernet.de>
2012-06-29s3:dbwrap_ctdb: fix a comment in db_ctdb_fetch()Michael Adam1-2/+3
Pair-Programmed-With: Gregor Beck <gbeck@sernet.de>
2012-06-29s3:dbwrap_ctdb: expand the comment for the db_ctdb_can_use_local_copy() functionMichael Adam1-1/+4
Pair-Programmed-With: Gregor Beck <gbeck@sernet.de>
2012-06-29s3:dbwrap_ctdb: rename db_ctdb_own_record() -> db_ctdb_can_use_local_copy()Michael Adam1-3/+3
This matches the function's intention much closer, since it also tests whether we have a valid local read only copy. Pair-Programmed-With: Gregor Beck <gbeck@sernet.de>
2012-06-29s3:dbrwap_ctdb: remove commented out legacy codeMichael Adam1-5/+1
2012-06-29s3:dbwrap_ctdb: fix fetch/fetch_locked when samba is built against old ctdbMichael Adam1-4/+3
The introduction of read only copies has broken the algorithm for deteting whether we can use the local record copy for fetch_locked and fetch: For fetch locked the new code always uses the local copy if there is one... This patch re-establish the original algorithm for the build against a ctdb without read only record copies. Reported-by: Gregor Beck <gbeck@sernet.de>
2012-06-27s3-param: Rename loadparm_s3_context -> loadparm_s3_helpersAndrew Bartlett1-1/+1
This helps clarify the role of this structure and wrapper function. The purpose here is to provide helper functions to the lib/param loadparm_context that point back at the s3 lp_ functions. This allows a struct loadparm_context to be passed to any point in the code, and always refer to the correct loadparm system. If this has not been set, the variables loaded in the lib/param code will be returned. As requested by Michael Adam. Andrew Bartlett Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Wed Jun 27 17:11:16 CEST 2012 on sn-devel-104
2012-06-27s3:lib:dbwrap: fix return value of db_ctdb_traverse[_read] for ↵Gregor Beck1-6/+17
non-persistent dbs to return the number of traversed records upon successful traverse. Signed-off-by: Michael Adam <obnox@samba.org>
2012-06-22dbwrap: remove get_flags().Rusty Russell1-8/+0
The flags returned were TDB-specific: this was only used for detecting the endianness of obsolete databases (the conversion code was put in in 2003, with reference to Samba 2.3). It's easier to remove it than to translate the NTDB flags to TDB flags, and it's a really weird thing to ask for anyway. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-05-13s3:lib:dbwrap: use [u]int[num]_t consistently in dbwrap_ctdb.cMichael Adam1-6/+8
2012-05-13s3:dbwrap: move definition of dbwrap_lock_order to dbwrap.hMichael Adam1-0/+1
This is needed in all of the library, not only in the dbwrap_open part.
2012-04-20s3-dbwrap: Add dbwrap_set_stored_callbackVolker Lendecke1-0/+1
This is a per-db function that is called whenever some record is modified
2012-04-20s3-dbwrap: Add dbwrap_db_idVolker Lendecke1-0/+11
This returns a blob uniquely identifying the database
2012-04-18s3-dbwrap: Fix an unused var warningVolker Lendecke1-0/+2
2012-04-17s3: Add dbwrap_try_fetch_lockedVolker Lendecke1-3/+33
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-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 Lendecke1-0/+1
2012-03-10tdb_wrap: Move to specific directory.Jelmer Vernooij1-1/+1
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-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 Lendecke1-2/+4
2011-12-15s3-dbwrap: Remove the "fetch" db_context callbackVolker Lendecke1-1/+0
Signed-off-by: Michael Adam <obnox@samba.org>