1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-15 23:24:37 +03:00

197 Commits

Author SHA1 Message Date
Rusty Russell
c153b85a93 Port from SAMBA tdb: commit 42c0931441ef53a3f977e1334355fa83f05ac184 Author: Tim Prouty <tprouty@samba.org> Date: Tue Mar 31 16:24:07 2009 -0700
tdb: Remove unused variable

(This used to be ctdb commit aa22d1875b1997664af983c0baeabe34e40dd253)
2009-08-04 16:43:10 +09:30
Rusty Russell
166e74a8b1 Port from SAMBA tdb:
commit b90863c0b7b860b006ac49c9396711ff351f777f
Author: Howard Chu <hyc@highlandsun.com>
Date:   Tue Mar 31 13:15:54 2009 +1100

    Add tdb_transaction_prepare_commit()

    Using tdb_transaction_prepare_commit() gives us 2-phase commits. This
    allows us to safely commit across multiple tdb databases at once, with
    reasonable transaction semantics

    Signed-off-by: tridge@samba.org

(This used to be ctdb commit 4c3dac215a088947f645f727343997f5d47e3260)
2009-08-04 16:43:06 +09:30
Ronnie Sahlberg
6feb7a1bf8 New attempt at TDB transaction nesting allow/disallow.
Make the default be that transaction is not allowed and any attempt to create a nested transaction will fail with TDB_ERR_NESTING.

If an application can cope with transaction nesting and the implicit
semantics of tdb_transaction_commit(), it can enable transaction nesting
by using the TDB_ALLOW_NESTING flag.

(This used to be ctdb commit 3e49e41c21eb8c53084aa8cc7fd3557bdd8eb7b6)
2009-05-25 17:04:42 +10:00
Ronnie Sahlberg
c429ca114d Revert "add TDB_NO_NESTING. When this flag is set tdb will not allow any nested transactions and tdb_transaction_start() will implicitely _cancel() any pending transactions before starting any new ones."
This reverts commit 459e4ee135bd1cd24c15e5325906eb4ecfd550ec.

(This used to be ctdb commit f1c6f7dd47bb1081781c0a0d567a92bbbc0aa5d5)
2009-05-25 16:54:25 +10:00
Ronnie Sahlberg
777c634eae add TDB_NO_NESTING. When this flag is set tdb will not allow any nested transactions and tdb_transaction_start() will implicitely _cancel() any pending transactions before starting any new ones.
(This used to be ctdb commit 459e4ee135bd1cd24c15e5325906eb4ecfd550ec)
2009-04-26 08:38:37 +10:00
Ronnie Sahlberg
ed2cf0291d second try for safe transaction stores into persistend tdb databases
for stores into persistent databases, ALWAYS use a lockwait child take out the lock for the record and never the daemon itself.

(This used to be ctdb commit 7fb6cf549de1b5e9ac5a3e4483c7591850ea2464)
2008-05-22 12:47:33 +10:00
Ronnie Sahlberg
cc5dc9fe31 dont emit the can not start transaction with locks held at all.
it just pollutes the logs

(This used to be ctdb commit c66e44d44f8d1142394ce5c6a68ac09fd67211fe)
2008-05-21 11:23:46 +10:00
Ronnie Sahlberg
26e5f71308 lower the debug level for the "can not start transaction" since we do expect this to happen a few times inside ctdb (since we cant really block and wait for all locks to dissapear before we can write the header, for example when doing a dmaster miration)
in those cases we accept that we couldnt get a transaction and then just writes the data "unsafely" anyway.

(This used to be ctdb commit 56af7df33456bf10d19b97cb005257720ac0b610)
2008-05-21 11:15:14 +10:00
Andrew Tridgell
f6ebcd6a55 carefully step around the recovery area when doing a tdb_wipe_all. This prevents
problems with wipe_all on databases that may need crash recovery

(This used to be ctdb commit e7b1349bf8784c151c2651edd99b3f40ebcece1f)
2008-02-08 14:10:54 +11:00
Andrew Tridgell
fbba202f1a fixed a problem with tdb growing after each recovery
(This used to be ctdb commit d754380961e67271809fed6c44f45356fe7a9c77)
2008-02-07 23:01:06 +11:00
Andrew Tridgell
1c35c8243e fixed a crash bug in the new transaction code
(This used to be ctdb commit 0d298e863c8ab2945fd329661c09ec6889152326)
2008-01-31 09:18:26 +11:00
Andrew Tridgell
ef02267c6e merge from samba4
(This used to be ctdb commit 21245b894b32f232251fd7c0e2fbfd073fb10514)
2008-01-18 15:48:36 +11:00
Andrew Tridgell
ce134656d5 more efficient freelist allocation
This takes advantage of the fact that we can do left merges but not right merges
By allocating data from the end of the freelist entry rather than the beginning
we can guarantee that if we immediately free the record again it will be merged
with the previous freelist entry, reducing fragmentation

(This used to be ctdb commit 6d159f2c115dd5e9b8bab8798f7ac710b4427593)
2008-01-18 13:32:54 +11:00
Andrew Tridgell
840ba4d5f6 minor fix to transaction_write_existing
(This used to be ctdb commit aa4e7578f78449c518730811220666e5e34adc06)
2008-01-15 15:28:07 +11:00
Andrew Tridgell
ddbe31e5aa fixed the bug that caused tdbtorture to fail
It was an error in the new transaction code

(This used to be ctdb commit 27f0dfdfb93d92859de3cbbd3874cfb38c13a169)
2008-01-14 15:11:10 +11:00
Andrew Tridgell
35e8f2ff6c tdb_freelist_size was reporting 1 more than correct size
(This used to be ctdb commit 46214c9234c574b45bce0b88bfb3af437415a69e)
2008-01-10 09:42:44 +11:00
Andrew Tridgell
bc85af6b61 a compromise for freelist scanning - we now will look for other than the first fit, but get exponentially more desperate as we get deeper into the freelist
(This used to be ctdb commit f3319ef84c47dc8bf0bfb4ef1c72cee58ed9d88c)
2008-01-09 15:33:10 +11:00
Andrew Tridgell
96100fcae6 added two new ctdb commands:
ctdb vacuum   : vacuums all the databases, deleting any zero length
                 ctdb records

 ctdb repack   : repacks all the databases, resulting in a perfectly
                 packed database with no freelist entries

(This used to be ctdb commit 3532119c84ab3247051ed6ba21ba3243ae2f6bf4)
2008-01-08 17:23:27 +11:00
Andrew Tridgell
ff039b405f - added tdb_add_flags() and tdb_remove_flags()
- make freelist merging more paranoid

- fixed TDB_DATA_STAART() (broken by earlier commit)

(This used to be ctdb commit c3be8eb7d1ca316111ec51f45dbca2fa5609cf93)
2008-01-06 12:33:57 +11:00
Andrew Tridgell
841a04924c merge from Samba4
(This used to be ctdb commit 9aed7a1d065272c2e5b54872228a73f37664b526)
2008-01-05 17:41:41 +11:00
Andrew Tridgell
67d2b14d90 convert tdb from u32 to uint32_t to match the current Samba trees
(This used to be ctdb commit 0dc754b7e8b0985a252885ed043949dfb7ea1ae1)
2008-01-05 17:22:47 +11:00
Andrew Tridgell
c2f84d6f4e Rewrote the tdb transaction code to be O(N) instead of O(N^2)
The previous transaction code was fast as long as you didn't do too
many writes within the transaction. The new code is a bit slower for
very small numbers of writes, but scales linearly as the number of
writes increases. The old code scaled as O(N^2) with the number of
writes, making it unusable for large N.

After testing, this needs to be merged into the Samba version of tdb,
along with many of the other recent tdb changes in the ctdb tree.

(This used to be ctdb commit bef8fe3d3ba80c7c660972c5357407f5278f7e26)
2008-01-05 17:19:47 +11:00
Andrew Tridgell
a54b88dba2 fixed data offset definition
(This used to be ctdb commit cef83d74883f6c66866fb7e5e17769322a3473da)
2008-01-05 12:10:18 +11:00
Andrew Tridgell
63b2d1c34e cleanup the new freelist code
(This used to be ctdb commit 76137104c7028b061578950d4b6b35ca8267fab1)
2008-01-05 12:09:00 +11:00
Andrew Tridgell
a21afe88bc added tdb_wipe_all() function
(This used to be ctdb commit 8e2d81cf54630970d66af92de2c0333acd2e1d22)
2008-01-05 12:08:41 +11:00
Andrew Tridgell
69fb0d3874 avoid write locks during delete checks in traversals
(This used to be ctdb commit dde9f3f0061988a0cdf10ee9e4db982c1b79ad1a)
2008-01-05 09:33:39 +11:00
Andrew Tridgell
9ea20f3916 expand tdb by minimum of 25% at a time
(This used to be ctdb commit 355575878e2b6e85268ca8387f41a19bcd9db651)
2008-01-05 09:30:09 +11:00
Andrew Tridgell
ea13223fbb prevent O(n^2) behaviour for traverse after large numbers of deletes
(This used to be ctdb commit e3c60552366f1d8d464c43efbcd6ed5a2a1adb71)
2008-01-04 12:12:02 +11:00
Andrew Tridgell
fa965dee8f quick fix for timeout in recovery
(This used to be ctdb commit 9205c681a819782d061bb41637191c130e91b100)
2008-01-02 12:04:07 +11:00
Andrew Tridgell
81bfa58d58 make sure we set close on exec on any possibly inherited fds
(This used to be ctdb commit d9dec82076f14a348e7b67b4350180681ff86f32)
2007-09-19 11:46:37 +10:00
Andrew Tridgell
3973b415be update lib/tdb from samba4
(This used to be ctdb commit 96a39ccee38bcfd64d614fe4670766e59ef246b6)
2007-07-10 15:32:27 +10:00
Andrew Tridgell
32de198fd3 update lib/replace from samba4
(This used to be ctdb commit f0555484105668c01c21f56322992e752e831109)
2007-07-10 15:29:31 +10:00
Andrew Tridgell
732353de5f - merged ctdb_store test from ronnie
- added DatabaseHashSize tunable
- added logging of events inside recovery (for timing)

(This used to be ctdb commit 3593cdb928b91e217faf1b3c537fa28dc82cdace)
2007-06-17 23:31:44 +10:00
Andrew Tridgell
edf03e88c8 global lock should imply the transaction lock
(This used to be ctdb commit 765a7e27344476ea8835565839b69872ea6ab6f0)
2007-05-22 13:14:51 +10:00
Andrew Tridgell
ae55e4181d added _mark calls for tdb_lockall
(This used to be ctdb commit e59134fd2af67c746b907c23fdcde2eccbbe17cf)
2007-05-12 14:33:10 +10:00
Andrew Tridgell
698d2a6af4 added nonblocking varients of the two lockall functions to tdb
(This used to be ctdb commit 2e99fa41ce01fa282bc0f3244ca42a78173743ed)
2007-05-10 17:43:08 +10:00
Andrew Tridgell
a3c70ac520 merge relevant lib code from samba4
(This used to be ctdb commit 8076a7c7e12da6d59bae31a2e4a0267d87c7b1b3)
2007-05-05 17:46:54 +10:00
Andrew Tridgell
d903e9542d added tdb_chainlock_mark() call, which can be used to mark a chain locked without actually locking it. This will be used to guarantee forward progress in the ctdb non-blocking lockwait code
(This used to be ctdb commit 2af98c3418496b39106c7282f550049ec8239657)
2007-05-05 17:14:33 +10:00
Andrew Tridgell
fccc585f5a added seqnum propogation code to ctdb
(This used to be ctdb commit be2572b1b09eaaa1ea6a726d60f16996f9407d13)
2007-05-04 22:18:00 +10:00
Andrew Tridgell
6bc3758082 added a tdb_enable_seqnum() function
(This used to be ctdb commit 1f89da231c6637e339d5da156d6a48340706fe61)
2007-05-04 15:29:10 +10:00
Andrew Tridgell
169f129404 merge latest versions of lib/replace, lib/talloc, lib/tdb and lib/events into ctdb bzr tree
(This used to be ctdb commit eaea8a9fa8d2f5e08f3af619fa1008a663f39053)
2007-05-02 07:32:04 +10:00
Andrew Tridgell
531f8237eb merge from samba4
(This used to be ctdb commit a64c6ace26559b2793f2a804430fb0fc53f03a34)
2007-04-21 10:09:37 +02:00
Andrew Tridgell
5afe9b709c merge tdb updates from samba4
(This used to be ctdb commit c9959e5741a17fd52070b744714eb00bf92a93eb)
2007-04-21 13:07:49 +10:00
Andrew Tridgell
7aa68f96f7 added a tdb_chainlock_nonblock() call to tdb
(This used to be ctdb commit 6587bdca71d97709c9271a73aea0be5a2a35f399)
2007-04-16 23:03:36 +10:00
Andrew Tridgell
8d2501e025 merge local copy of tdb from samba4 tdb
(This used to be ctdb commit d4619ce98ce44acaebeb6ae9c516a7917bf4e27f)
2007-04-16 22:52:58 +10:00
Andrew Tridgell
cc2696cc50 added rest of tdb (missed in earlier commit)
(This used to be ctdb commit 4c1434cc4613fc94958de0aa882bf7ca41ec8458)
2007-02-20 13:24:45 +11:00
Andrew Tridgell
e1797cf6be added copies of libs so can be built standalone
(This used to be ctdb commit 0bf6e6cb371bb946ea8cc1d8c7a23a41ea715832)
2007-01-25 15:10:40 +11:00