python tests broken (Re: s4:samldb LDB module - "member" trigger)

Stefan (metze) Metzmacher metze at samba.org
Thu Nov 4 03:20:00 MDT 2010


Hi Matthias,

> I like your patch - please merge it!

Thanks!

What do you think about this one?

http://gitweb.samba.org/?p=metze/samba/wip.git;a=commitdiff;h=576e78571b65aa5a3e593

metze

> Stefan (metze) Metzmacher wrote:
>> Hi,
>>
>>   
>>> Metze mentioned this patch to me on IRC as he chases down some
>>> performance issues, and I wanted to comment on it.  He may make further
>>> comments once he finishes pinning down his issue.
>>>
>>> The problem I have with the patch is that it seems very inefficient, and
>>> I wondered if you had considered the O() notation complexity of this
>>> validation.
>>>
>>> For every member being added, you now do a search on the entry for that
>>> member, rather than just let ldb_tdb complain about the duplicate
>>> attribute when we eventually store it.  Why is this?  If an member
>>> attribute gains 100 members, you now do 100 searches of the DB just to
>>> check that they are not already there.  The cost of that search is
>>> rougly proportional to the number of members already being added -
>>> particularly if done one at at a time, so this seems to be O(n^2).
>>>
>>> And similarly, whey trying to determine if the member attribute would
>>> conflict with a primaryGroupID, why not first (and only once) read the
>>> sid of the entry, and then compare with the primaryGroupID of the
>>> target?
>>>
>>> Surely this would be faster than dereferencing the member attribute,
>>> only to form up a SID and compare it with our own DN?
>>>      
>> I fixed the problem, but I can't verify my changes with make test.
>> http://gitweb.samba.org/?p=metze/samba/wip.git;a=commitdiff;h=61a818143ba777
>>
>>
>> I discovered that 21 of 30 python tests are broken, currently!
>> The piping through filter-subunit just ignores the errors...
>>
>> This patch add the logic to let us notice the errors again.
>> http://gitweb.samba.org/?p=metze/samba/wip.git;a=commitdiff;h=4aa453ca538e77d
>>
>>
>> Most tests fail with:
>>
>> [25/30 in 1m46s, 18 errors] samba4.ldap.acl.python(fl2008r2dc)
>> Traceback (most recent call last):
>>    File
>> "/home/metze/devel/samba/4.0/master4-drsuapi/source4/dsdb/tests/python/acl.py",
>>
>> line 12, in<module>
>>      samba.ensure_external_module("subunit", "subunit/python")
>>    File
>> "/home/metze/devel/samba/4.0/master4-drsuapi/source4/bin/python/samba/__init__.py",
>>
>> line 319, in ensure_external_module
>>      __import__(modulename)
>>    File
>> "/home/metze/devel/samba/4.0/master4-drsuapi/source4/bin/python/samba/../../../../lib/subunit/python/subunit/__init__.py",
>>
>> line 128, in<module>
>>      from testtools import content, content_type,
>> ExtendedToOriginalDecorator
>> ImportError: No module named testtools
>>
>> Jelmer can please take a look at this and fix it?
>>
>> metze
>>
>>    
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20101104/cfd9cc56/attachment.pgp>


More information about the samba-technical mailing list