1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-30 19:42:05 +03:00

s4:provision Keep a single transaction for the erase and rebuild

Using a single transaction to both erase the bulk of the data and the
rebuild of that data means that the in-memory index list is
maintained, and not written out to disk until it is all compleated.
All the writes then occour at the end.

Andrew Bartlett
This commit is contained in:
Andrew Bartlett
2009-08-14 08:29:19 +10:00
parent ecd234a0f1
commit 410114e41c

View File

@ -838,24 +838,15 @@ def setup_samdb(path, setup_path, session_info, credentials, lp,
# Load the schema (again). This time it will force a reindex, to make the below computationally sane
samdb.set_schema_from_ldb(schema.ldb)
samdb.erase_partitions()
except:
samdb.transaction_cancel()
raise
samdb.transaction_commit()
samdb.set_opaque_integer("domainFunctionality", domainFunctionality)
samdb.set_opaque_integer("forestFunctionality", forestFunctionality)
samdb.set_opaque_integer("domainControllerFunctionality", domainControllerFunctionality)
samdb.set_opaque_integer("domainFunctionality", domainFunctionality)
samdb.set_opaque_integer("forestFunctionality", forestFunctionality)
samdb.set_opaque_integer("domainControllerFunctionality", domainControllerFunctionality)
samdb.set_domain_sid(str(domainsid))
if serverrole == "domain controller":
samdb.set_invocation_id(invocationid)
samdb.set_domain_sid(str(domainsid))
if serverrole == "domain controller":
samdb.set_invocation_id(invocationid)
samdb.transaction_start()
try:
message("Adding DomainDN: %s" % names.domaindn)
if serverrole == "domain controller":
domain_oc = "domainDNS"