summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/ldb_tdb/ldb_tdb.c
AgeCommit message (Collapse)AuthorFilesLines
2009-10-02s4-ldb: merged with masterAndrew Bartlett1-78/+109
2009-09-23fixed spellingAndrew Tridgell1-1/+1
2009-09-21s4:ldb Add 'single-value' support to LDB.Andrew Bartlett1-2/+47
This is currently only triggered via Samba4's schema code.
2009-07-14remove all '\n' from ldb_debugSumit Bose1-1/+1
2009-06-04fixed ldb rename now that we have unique indexesAndrew Tridgell1-30/+11
With unique indexes, any rename of a record that has an attribute that is uniquely indexed needs to be done as a delete followed by an add, otherwse you'll get an error that the attribute value already exists.
2009-03-31added support for a prepare_commit() op in ldb modulesAndrew Tridgell1-2/+31
This op will be used by the partition module to give us good transaction semantics across the 4 partitions that sam.ldb uses.
2009-03-10Fix extended operation return path.Simo Sorce1-8/+12
Extended operations return was not going thorugh the same patch as others leaving the ctx around. Plus we were neutralizing the spy too early so that it didn't set the request_terminated flag as it should have. This should hopefully fix the failures in the build farm.
2009-03-09Fix potential segfaults using freed memory.Simo Sorce1-5/+44
In some code paths ltdb_context was still referenced even after we were returned an error by one of the callbacks. Because the interface assumes that once an error is returned the ldb_request may be freed, and because the ltdb_context was allocated as a child of the request, this might cause access to freed memory. Allocate the ltdb_context on ldb, and keep track of what's going on with the request by adding a spy children on it. This way even if the request is freed before the ltdb_callback is called, we will safely free the ctx and just quietly return.
2009-02-23Make all transactions nested in ldb. The current samba4 code expects thisSimo Sorce1-0/+2
behavior anyway, and given we can only have one transaction active per ldb context this is the only sane model we can support. Fix ldb_tdb transactions, we could return back with an error with neither committing nor canceling the actual tdb transaction in some error paths within the ltdb commit and cancel transaction paths. Added also some debugging to trace what was going on.
2009-01-30Fix the mess with ldb includes.Simo Sorce1-57/+72
Separate again the public from the private headers. Add a new header specific for modules. Also add service function for modules as now ldb_context and ldb_module are opaque structures for them.
2009-01-21s4:ldb: remove dependency to samba4's events wrapperStefan Metzmacher1-2/+2
metze
2008-12-29s4:lib/tevent: rename structsStefan Metzmacher1-6/+6
list="" list="$list event_context:tevent_context" list="$list fd_event:tevent_fd" list="$list timed_event:tevent_timer" for s in $list; do o=`echo $s | cut -d ':' -f1` n=`echo $s | cut -d ':' -f2` r=`git grep "struct $o" |cut -d ':' -f1 |sort -u` files=`echo "$r" | grep -v source3 | grep -v nsswitch | grep -v packaging4` for f in $files; do cat $f | sed -e "s/struct $o/struct $n/g" > $f.tmp mv $f.tmp $f done done metze
2008-12-17an experimental patch for fixing ldb bloatAndrew Tridgell1-0/+10
ldb indexing can cause huge files, and huge memory usage. This experiment allows us to keep indexes in memory during a transaction, then to write the indexes to disk when the transaction completes. The result is that the db is much smaller (we have seen improvements of about 100x in file size) and memory usage during large transactions is also greatly reduced Note that this patch uses the unusual strategy of putting pointers into a ldb (and thus into a tdb). This works because the pointers are only there during a transaction, so the pointers are not exposed to any other users of the database. The pointers allow us to avoid some really bad allocation problems with tdb record allocation during the re-indexing.
2008-11-17Remove timeout event once we are calling the callback.Andrew Bartlett1-4/+5
(Even if the callback takes some time, this isn't a ldb_tdb timeout any more) Andrew Bartlett
2008-10-20Make sure prototypes are always included, make some functions static andJelmer Vernooij1-2/+2
remove some unused functions.
2008-10-16Transform the sequence_number operation into a normal extended operation as ↵Simo Sorce1-25/+119
it should always have been. Make it also async so that it is not a special case.
2008-09-29LDB ASYNC: ldb_tdb backendSimo Sorce1-181/+172
2008-09-25Revert LDB return code patches from Matthias.Jelmer Vernooij1-10/+10
2008-09-24Cosmetic corrections for the LDB backend modulesMatthias Dieter Wallnöfer1-10/+10
This commit applies some cosmetic corrections for the LDB backend modules.
2008-06-14Cleanup,Simo Sorce1-61/+88
Remove trailing spaces and try to fit 80 columns where possible (This used to be commit edf6b77a1314d8f91839836855ae049393f73aca)
2008-02-20Remove more function-based inits.Jelmer Vernooij1-4/+4
(This used to be commit b1a7810f3e70f9a831d9b8e85d531e448072adaf)
2007-12-24r26574: Do not call functions in the variable declaration, fix checking for ↵Simo Sorce1-5/+7
tmp_ctx, and also makes code more readable and debuggable. Eliminate silly parenthesys. Simo. (This used to be commit 166195b487ffa51933f772a56f47f7f0d4c867eb)
2007-12-21r25690: - only use a readonly traverse in ldb_search when not in a ↵Andrew Tridgell1-0/+6
transaction. When we are in a transaction then we could be in a top level modify operation (such as rename), so we must use a writeable traverse so that the async callbacks can do the modifies while the search is progressing. - don't do the lockall operation on the tdb during a ldb search if in a transaction, as this would prevent modifies by callbacks as well (This used to be commit aa9ab431e071882f42ebc882e809ae1d4b8778d4)
2007-10-10r25215: replace talloc_append_string() with talloc_strdup_append_buffer()Stefan Metzmacher1-1/+1
metze (This used to be commit 8f2db3c130ce85d38f805836a7df039822ede066)
2007-10-10r25204: Patch by Andrew Kroeger <andrew@sprocks.gotdns.com> fixing bug #4958 -Andrew Bartlett1-9/+31
rename of ldb entries for a case change (only). I've modified the testsuite to verify this. Andrew Bartlett (This used to be commit 9cccd00dac44dd9152ec03cecf5ffac24f918445)
2007-10-10r23798: updated old Temple Place FSF addresses to new URLAndrew Tridgell1-2/+1
(This used to be commit 40c0919aaa9c1b14bbaebb95ecce53eb0380fdbb)
2007-10-10r23795: more v2->v3 conversionAndrew Tridgell1-1/+1
(This used to be commit 84b468b2f8f2dffda89593f816e8bc6a8b6d42ac)
2007-10-10r23762: Fix DN renames over LDAP, and instrument the partition module. Add aAndrew Bartlett1-3/+2
test to prove the behaviour of LDAP renames etc. Fix LDB to return correct error code when failing to rename one DN onto another. Andrew Bartlett (This used to be commit 3f3da9c4710b7752ed97f55c2fc3d32a63d352af)
2007-10-10r23737: Validate that we object to duplicate values in an add or replace.Andrew Bartlett1-10/+25
We can't ever allow duplicates, even if the client sends them Andrew Bartlett (This used to be commit 10277f27246b9e16ed36fb72eb4c318b43cb9395)
2007-10-10r23364: add LDB_FLG_NOMMAP flagAndrew Tridgell1-0/+5
(This used to be commit 0c3442c68b01b6804f3fd966fc1fe9097eb863aa)
2007-10-10r22681: Fix standalone ldb build when parent directory name != ldb.Jelmer Vernooij1-3/+2
(This used to be commit 1093875d59f1ea9b8bd82277d4f9d8366e584952)
2007-10-10r22471: Convert more code to use proper LDB error codes.Simo Sorce1-25/+21
This is a 1 to 1 convertion, next step is to make this code report an error if the basedn is not used, hopefully avoiding an explicit search on the base object in the most common cases. (This used to be commit 50534c84b4577b2d32565a74a4716088f706bfea)
2007-10-10r20865: remove useless warning, we now always pass the current partitionStefan Metzmacher1-25/+10
control as non critical control metze (This used to be commit 21fddb643bf05ca2b7c60a4695e1fff0f29ec6d1)
2007-10-10r20184: change ldb_attrib_handler into ldb_schema_attribute, which has a pointerStefan Metzmacher1-3/+3
to a ldb_schema_syntax struct. the default attribute handler is now registered dynamicly as "*" attribute, instead of having its own code path. ldb_schema_attribute's can be added to the ldb_schema given a ldb_schema_syntax struct or the syntax name we may also need to introduce a ldb_schema_matching_rule, and add a pointer to a default ldb_schema_matching_rule in the ldb_schema_syntax. metze (This used to be commit b97b8f5dcbce006f005e53ca79df3330e62f117b)
2007-10-10r20106: Optional ONE Level indexing for ldb_tdbSimo Sorce1-0/+12
To activate it you must modify the @INDEXLIST object adding the attribute @IDXONE: 1 Ldb test included Simo. (This used to be commit ea111795f4016916473ccc05d23c6655e6af1207)
2007-10-10r19911: talloc_apsrintf is not really required hereSimo Sorce1-1/+5
its faster this way (another 2-4%s) (This used to be commit 8bbbfa3467c00543b0b330aec14e22b7e796fea7)
2007-10-10r19832: better prototypes for the linearization functions:Simo Sorce1-14/+6
- ldb_dn_get_linearized returns a const string - ldb_dn_alloc_linearized allocs astring with the linearized dn (This used to be commit 3929c086d5d0b3f08b1c4f2f3f9602c3f4a9a4bd)
2007-10-10r19831: Big ldb_dn optimization and interfaces enhancement patchSimo Sorce1-8/+6
This patch changes a lot of the code in ldb_dn.c, and also removes and add a number of manipulation functions around. The aim is to avoid validating a dn if not necessary as the validation code is necessarily slow. This is mainly to speed up internal operations where input is not user generated and so we can assume the DNs need no validation. The code is designed to keep the data as a string if possible. The code is not yet 100% perfect, but pass all the tests so far. A memleak is certainly present, I'll work on that next. Simo. (This used to be commit a580c871d3784602a9cce32d33419e63c8236e63)
2007-10-10r19402: - use the new tdb_lockall_read() to make ldb_search() more efficient,Andrew Tridgell1-1/+1
by avoiding chain locks on each tdb_fetch() within the search - use the tdb_get_seqnum() call to avoid re-reading the @BASEINFO record when it hasn't changed. These speed up the LOCAL-DBSPEED test for ldb from 7k ops/sec to a bit over 11k ops/sec (This used to be commit 1347ad254eb8cd12ce22a5a2a37bec0a0ac8dbf1)
2007-10-10r19362: - don't need to store the baseinfo message after cache loadAndrew Tridgell1-0/+7
- set better names on talloc structures in ldb modules, making leaks easier to track down (This used to be commit 3bf76db42dc6dde5d71083216dba819869b31c75)
2007-10-10r19338: leak on errorSimo Sorce1-0/+1
(This used to be commit 326389afed0521133ac07339bd5e2bfbf8d80d0a)
2007-10-10r19314: Commit tridge's fixes for a big mem leak in ltdb I introducedSimo Sorce1-9/+8
when the code has been changed to be async. With the other committed fixes now this works. (This used to be commit 49fc640b5c0398516ac3a9e3f7c55205cd60b1de)
2007-10-10r19196: merge from samba3:Stefan Metzmacher1-1/+1
pass always a mem_ctx to functions and a ldb_context where needed metze (This used to be commit 67a6a41ba3af840cd8226de73576a90ecf602caa)
2007-10-10r19134: Merge the second set of C++ warning fixes from Samba3. I'll leave ↵Volker Lendecke1-6/+12
r19132 to metze to merge until the questions have been answered. Volker (This used to be commit e946717bf600f4ff922dc55a9a5d259535d0d1c9)
2007-10-10r18942: add a ldb_set_create_perms() function in ldb. I didn't call itAndrew Tridgell1-1/+2
ldb_set_umask() (which is what we had discussed) as it doesn't actually set the umask (in effect it sets the inverse of the umask - the perms to be used for the file) (This used to be commit 7e2ec875908c112d5c3b0f6d18f9a8bbacf33539)
2007-10-10r18939: don't rely on the umask being right in ldb creation. Both Samba3 andAndrew Tridgell1-1/+1
Samba4 smbd force the umask to 0, which meant we ended up with ldb being world writable. This isn't really an ideal fix, as it means ldb no longer honors umask (as it should do, like all good libraries). Unfortunately the 'proper' fix is too complex for now this also merges a tiny code style fix from s4 to s3 (This used to be commit 1a42f38dfdc55d7429a1f8d3e811f3d857195a58)
2007-10-10r18781: Move the usnCreated and usnChanged handling around again.Andrew Bartlett1-1/+22
This moves these attributes from objectguid into an optional backend (objectguid), used by ltdb. For OpenLDAP, the entryUUID module converts entryCSN into usnChanged. This also changes the sequence number API, and uses 'time based' sequence numbers, when an LDAP or similar backend is detected. To assist this, we also store the last modified time in the TDB, whenever we change a value. Andrew Bartlett (This used to be commit 72858f859483c0c532dddb2c146d6bd7b9be5072)
2007-10-10r17711: fix compiler warningsStefan Metzmacher1-1/+0
metze (This used to be commit f3dc51fef53287cc2e2af7ed4a9f3f52a5cd06ed)
2007-10-10r17516: Change helper function names to make more clear what they are meant ↵Simo Sorce1-1/+1
to do (This used to be commit ad75cf869550af66119d0293503024d41d834e02)
2007-10-10r17514: Simplify the way to set ldb errors and add anotherSimo Sorce1-20/+11
helper function to set them. (This used to be commit 260868bae56194fcb98d55afc22fc66d96a303df)