upgrade provision script TP1

Matthieu Patou mat+Informatique.Samba at matws.net
Mon Aug 24 00:52:02 MDT 2009

On 08/24/2009 10:13 AM, Andrew Bartlett wrote:
> On Mon, 2009-08-24 at 01:45 +0400, Matthieu Patou wrote:
>> Hello andrew,
>> I've been pushing quite hard on this upgrade script.
>> So far it only upgrades the schema but most is already in to do upgrade
>> for the whole sam.ldb (schema, users,configuration).
>> I'd like that anyone interested throw an eye on it, of course it is a
>> bit rough but it's more or less like this that I think my script will be.
> Why do you shell out to provision, rather than run the provision()
> function from within python?
Because for the beginning I was a bit lazy and I know that I can make 
more clean once the big problems are solved, also to my mind it looks 
that the provision scripts do a lot of stuff to prepare variable that I 
didn't wanted to bother with right now but definitly it's on my road map 
to call this function directly but rather at the end ...
>> So for the good part it's able to upgrade the schema but it's worth
>> noting that after this all the LDB actions are much more slower ...
>> The size of the schema.ldb jumped to 75M (starting from a file with 15M)
>> and the freshly generated is 25M.
>> About slowness I just discovered that doing an ldbedit -H sam.ldb -b
>> "xx" on any modified partition put things in a better way (execution
>> time of upgradeschema drops from 30's for doing no modification to 15',
>> it's 21's when it's run for the first time stuff is done.
>> I don't know what's going on underneath sounds like a kind of reindexing
>> or reorganization, is there a way to trigger it in python (running the
>> the script more than once do not do the trick)
> It probably triggers the reindex after loading the schema from the
> database.
Is there a way to trigger it from python ?


More information about the samba-technical mailing list