summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/ldb_tdb
AgeCommit message (Collapse)AuthorFilesLines
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-06-01use the unique flag on ldb attributes to optimise & clausesAndrew Tridgell1-46/+72
When a attribute is marked unique we know that if we find a match it will be the only possible match. This means that in a list of subtrees connected by an &, it is best to first load the index values for the unique entries, as if they find something then we know we won't have to look any further. This helps with searches like this: (&(objectclass=user)(samaccountname=tridge)) the old code would first have loaded the very large index for the objectclass=user attribute, and then loaded the single entry for samaccountname=tridge. Now we load the samaccountname=tridge entry first, notice that it gives us a single result, and stop, thereby skipping the load of the objectclass=user index record completely.
2009-06-01added support for unique indexing in ldbAndrew Tridgell1-7/+26
When a attribute is marked as LDB_ATTR_FLAG_UNIQUE_INDEX then attempts to add a 2nd record that has the same attribute value for this attribute as another record will fail. This provides a much more efficient mechanism for ensuring that attributes like objectGUID are unique
2009-05-28a useful debugging toolAndrew Tridgell1-0/+7
When looking at performance problems with ldb it can be useful to see which searches causes unindexed full searches. This makes it easy to enable that.
2009-05-28fixed one-level indexingAndrew Tridgell1-6/+2
one-level indexing was not always effective due to some broken logic in the indexing code. This change means that if normal indexing fails, we can still fall back on one-level indexing. This reduces the number of full unindexed searches in s4 quite a lot
2009-04-07don't load @ATTRIBUTES if we have an override handler in placeAndrew Tridgell1-0/+7
2009-03-31added support for a prepare_commit() op in ldb modulesAndrew Tridgell2-2/+32
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 Sorce4-10/+54
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-23Fix headers, ldb_includes.h is a private header,Simo Sorce2-7/+2
do not reference it from ldb.h
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 Sorce7-132/+207
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 Metzmacher2-7/+7
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-19s4:cosmetic: Remove trailing tabs and spacesSimo Sorce1-59/+59
2008-12-19Small cosmetic LDB patch regarding return values.Matthias Dieter Wallnöfer1-4/+4
It changes some "return 0" in "return LDB_SUCCESS"
2008-12-18Rename ldb index pointer wrapper functionAndrew Bartlett1-8/+8
This also asserts that it is used only for index records. Andrew Bartlett
2008-12-17s4:ldb: make it possible to return per entry controlsAndrew Bartlett2-2/+2
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2008-12-17an experimental patch for fixing ldb bloatAndrew Tridgell3-9/+352
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-12-16repack the ldb after re-indexingAndrew Tridgell1-0/+4
re-indexing in ldb is triggered on any modification to the @ATTRIBUTES or @INDEXLIST records. This happens to produce a worst-case fragmentation of the database, as all @INDEX records are deleted then re-created. By repacking after re-indexing we ensure that the database ends up without extreme fragmentation.
2008-11-17Remove timeout event once we are calling the callback.Andrew Bartlett2-4/+6
(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 Vernooij2-3/+3
remove some unused functions.
2008-10-16Transform the sequence_number operation into a normal extended operation as ↵Simo Sorce3-49/+121
it should always have been. Make it also async so that it is not a special case.
2008-09-29LDB ASYNC: ldb_tdb backendSimo Sorce4-315/+242
2008-09-25Revert LDB return code patches from Matthias.Jelmer Vernooij5-49/+49
2008-09-24Cosmetic corrections for the LDB backend modulesMatthias Dieter Wallnöfer5-49/+49
This commit applies some cosmetic corrections for the LDB backend modules.
2008-09-18Generate with 1.3.36.Jelmer Vernooij1-0/+4
2008-08-22fixed a speellling erraAndrew Tridgell1-1/+1
(This used to be commit 3c058f50cc3b91d540feb51fb698d90565b2b7c9)
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-04-17use uintptr_t instead of intptr_t where appropriateAndrew Tridgell1-2/+2
(This used to be commit d62f2bcc85c13605c133db250e0a86d2d6ccc481)
2008-02-20Remove more function-based inits.Jelmer Vernooij1-4/+4
(This used to be commit b1a7810f3e70f9a831d9b8e85d531e448072adaf)
2008-01-06r26684: Trivial cleanup from Matthias Dieter Wallnöfer, from bug 5090Andrew Bartlett1-1/+1
Andrew Bartlett (This used to be commit 0016231edd514e8db620bafc44ce877fcac19ed9)
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-21r26200: Bring back some accidently removed files.Jelmer Vernooij1-0/+153
(This used to be commit a71e40ab5dc7f0a5f6d2d1eb930f378cd143b186)
2007-12-21r26197: Add bindings for libsecurity.Jelmer Vernooij1-153/+0
(This used to be commit 8625cd403ba3a7d2b1b1fccfeb5efd7e21de0135)
2007-12-21r26131: Ensure we show the right errors in the NULL base DN case. Based onAndrew Bartlett1-0/+2
bug 5090 by Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de> Andrew Bartlett (This used to be commit cc2d0c9f15a9c687d212df14d8ffb6c60ad15242)
2007-12-21r25965: Remove duplicate block - thanks metze!Andrew Bartlett1-18/+0
Andrew Bartlett (This used to be commit d7e65da56454bc7721083e0aa7fa2e9c47f2b79d)
2007-12-21r25964: Fix comment and use talloc hirachy in ldb_tdb initialisation.Andrew Bartlett1-4/+2
Andrew Bartlett (This used to be commit 05cc2a7d966a10f1f111d7bae3261e1087fdffe6)
2007-12-21r25959: Add a new special DN to LDB: @OPTIONSAndrew Bartlett3-17/+144
Use the checkBaseOnSearch attribute to control if we should check the base DN on search requests. Also ensure we honour any errors in searching, not just errors in the supplied 'done' callback. Andrew Bartlett (This used to be commit deaac92f439ef001bfe052df170d6e34e8ba5845)
2007-12-21r25893: Fix ldb, tdb builds (and one warning).Jeremy Allison1-0/+2
Jeremy. (This used to be commit 52b26645b04a9c5fb70e7b869b60c9157f821d50)
2007-12-21r25690: - only use a readonly traverse in ldb_search when not in a ↵Andrew Tridgell3-3/+21
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-10r25218: After discussion with Simo, remove the subclass support from LDB.Andrew Bartlett3-137/+0
Subclass support was designed to avoid needing to spell out the full list of objectClasses that an entry was in. However, Samba4 now enforces this restriction in the objectClass module, and the way subclass matching was handled was complex and counter-intuitive in my opinion (and did not match LDAP). Andrew Bartlett (This used to be commit f5ce04b904e14445a2a7e7f92e7e1f64b645c6f2)
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-10r25084: Move samba-specific code out of lib/ldb directory.Jelmer Vernooij1-8/+1
(This used to be commit 917bd737cb07817664d9088860588d47525f5ff8)
2007-10-10r25000: Fix some more C++ compatibility warnings.Jelmer Vernooij3-17/+17
(This used to be commit 08bb1ef643ab906f1645cf6f32763dc73b1884e4)
2007-10-10r23798: updated old Temple Place FSF addresses to new URLAndrew Tridgell6-12/+6
(This used to be commit 40c0919aaa9c1b14bbaebb95ecce53eb0380fdbb)
2007-10-10r23795: more v2->v3 conversionAndrew Tridgell6-6/+6
(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)