summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/ldb_tdb/ldb_tdb.c
AgeCommit message (Collapse)AuthorFilesLines
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)
2007-10-10r17350: Avoid a couple of memleaks, unnecessary code and use a more linear styleSimo Sorce1-27/+12
(This used to be commit 97c4d41a30a5d85145abb781cb7001b502bc7dcb)
2007-10-10r17349: We can't just return sucess here, modules below us expect the asyncAndrew Bartlett1-24/+31
reply rules to be followed. Add code to do a fake async callback on the skipped records. Andrew Bartlett (This used to be commit 26bc7dbed978f92e814d9803366eac7d7f4ded3e)
2007-10-10r17304: Improve ldb_tdb error strings a bit more.Andrew Bartlett1-2/+23
Andrew Bartlett (This used to be commit 38bd4f61794e5a664822240d77c1e1c61abc7c44)
2007-10-10r17186: "async" word abuse clean-up part 2Simo Sorce1-24/+24
(This used to be commit c6aa60c7e69abf1f83efc150b1c3ed02751c45fc)
2007-10-10r17185: Oh, I wanted to do this for sooo long time.Simo Sorce1-16/+16
Finally acknowledge that ldb is inherently async and does not have a dual personality anymore Rename all ldb_async_XXX functions to ldb_XXX except for ldb_async_result, it is now ldb_reply to reflect the real function of this structure. Simo. (This used to be commit 25fc7354049d62efeba17681ef1cdd326bc3f2ef)
2007-10-10r16932: Consistanly use the macro for these DNs and attributes.Andrew Bartlett1-2/+2
Andrew Bartlett (This used to be commit dd6ca3342218aa25619a98d48e0efbbe31012c30)
2007-10-10r16774: This patch modifies the tdb API to allow the logging function to be usedAndrew Bartlett1-2/+2
as part of ldb. This allows tdb failures to be passed all the way up to Samba's DEBUG system, which allowed easier debugging. Unfortunately I had to extend the tdb API, as the logging function didn't have a context pointer. I've worked over the 'debug levels' in TDB. Most of them were 0, which didn't seem right, as some were trace-like messages. We didn't see any of these previously, except when accessing TDB directly. Andrew Bartlett (This used to be commit 58898092c1ce043f6d698db5065f372b79109e22)
2007-10-10r16087: Fix silly cut-and-paste typo that cost me much of my afternoon...Andrew Bartlett1-1/+1
This only affects my new partitions module, which I will post soon, but should be fixed anyway. Andrew Bartlett (This used to be commit 8912c4e057eb3962321245cf49b92999afcc64fc)
2007-10-10r16083: Make it possible to initialise a backend module, without it setting upAndrew Bartlett1-21/+31
the whole ldb structure. Because the sequence number was a fn pointer on the main ldb context, turn it into a full request (currently sync). Andrew Bartlett (This used to be commit fbe7d0ca9031e292b2d2fae263233c973982980a)