[PATCH] Have ldbmodify and ldbadd operate in a single transaction

Andrew Bartlett abartlet at samba.org
Wed Apr 4 04:29:34 MDT 2012


On Wed, 2012-04-04 at 12:21 +0200, Stefan (metze) Metzmacher wrote:
> Am 04.04.2012 11:13, schrieb Andrew Bartlett:
> > The attached patches make ldbmodify and ldbadd operate in a single
> > transaction, and abort that transaction on failure. 
> > 
> > Matthieu, this also reverts your previous attempt at doing this.  It
> > should help your schema work, as each transaction causes a schema
> > reload, which can be a problem for mutually dependent schema items.
> > 
> > It also fixes up our tests to both pass and cause failures on failure,
> > by wrapping it in the right subunit. 
> > 
> > I've also put them in my git tree:
> > https://git.samba.org/abartlet/samba.git/?p=abartlet/samba.git/.git;a=shortlog;h=refs/heads/ldb-one-transaction
> 
> Can we add an option to control the behavior?
> For things like the ldap backend we don't have transactions anyway,
> we might want to return an error there if the caller asks for a single
> transaction.

For forcing it on, the problem is, at the moment this silently succeeds
(the transaction hooks are there, and just return success), and it is
the default on local ldb files.  For forcing it off, if the user wants
'one transaction per block' against a local ldb file, they can always
invoke ldbmodify/ldbadd with multiple files.  (These are already handled
as distinct transactions). 

For that reason, I don't think an additional option adds any more value,
for the very few possible users. 

Andrew Bartlett

-- 
Andrew Bartlett                                http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org




More information about the samba-technical mailing list