always use prepare_commit in ldb transaction commits if possible
authorAndrew Tridgell <tridge@samba.org>
Thu, 3 Sep 2009 08:29:58 +0000 (18:29 +1000)
committerAndrew Tridgell <tridge@samba.org>
Thu, 3 Sep 2009 08:36:09 +0000 (18:36 +1000)
commitbfccc4590dc94b37258b7225d153c4c01d1a28d6
tree901027032373df9aaffc0ee1b3e44c57bd93d46e
parentc37f290043c55ec6428a313b4ec3ca2f91e5e98e
always use prepare_commit in ldb transaction commits if possible

The reason we need this is to make multi-tdb transactions safe, with
the partition module. The linked_attributes and repl_meta_data modules
now do extra processing when the transaction ends, and that processing
can fail. When it fails we need to cancel the transaction, which we
can only do if the hook is on the prepare commit instead of the end
transaction call. Otherwise the partition module cannot ensure that no
commit has been done on another partition.
source4/lib/ldb/common/ldb.c
source4/lib/ldb/common/ldb_modules.c
source4/lib/ldb/include/ldb_module.h