[PATCH] classicupgrade: tell tdb not to use fsync

Andrew Bartlett abartlet at samba.org
Wed Jul 10 16:47:47 MDT 2013

On Wed, 2013-07-10 at 18:37 +0200, Björn Jacke wrote:
> this speeds up the classicupgrade process a lot and we don't really need
> syncing for data security here.
> Signed-off-by:: Björn Jacke <bj at sernet.de>

I'm curious as to if this was seen before or after I added
34820602715cc8936179091e188993f7a42808ac to the tree.  (Wrapping it in
one transaction should also help avoid the fsync(), but my patch may not
have actually done that).

Either way, I agree with the idea and think we should probably do the
same during provision and join as well. 

I don't however think the patch is in the right spot - it should be in
the run() routine.  (I was going to suggest it being in
upgrade_from_samba3, but that is essentially a library routine and
changing the global environment there would be rude). 

It is important:  I was a few months ago working with a user who is
importing a very, very large Samba domain, and their runtime was
measured in hours!


Andrew Bartlett

> ---
>  python/samba/netcmd/domain.py | 3 +++
>  1 file changed, 3 insertions(+)
> diff --git a/python/samba/netcmd/domain.py b/python/samba/netcmd/domain.py
> index 4ba305c..e4d921c 100644
> --- a/python/samba/netcmd/domain.py
> +++ b/python/samba/netcmd/domain.py
> @@ -1229,6 +1229,9 @@ class cmd_domain_classicupgrade(Command):
>      takes_args = ["smbconf"]
> +    # for mass import during classicupgrade we don't want ldb to fsync() all the time
> +    os.environ["TDB_NO_FSYNC"] = "1"
> +
>      def run(self, smbconf=None, targetdir=None, dbdir=None, testparm=None,
>              quiet=False, verbose=False, use_xattrs=None, sambaopts=None, versionopts=None,
>              dns_backend=None, use_ntvfs=False):

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

More information about the samba-technical mailing list