Hi, On 2010-06-02, Peter Uittenbroek <[email protected]> wrote: > Hello, > > We have a problem with deleting users on a massive (12GB, 1,6M objects) > database. I've localized the problem into the deleteLocalRoles function > in Products.CMFCore-2.1.2-py2.4.egg/Products/CMFCore/MembershipTool.py > > http://pastie.org/988936 > > It's a recursive function which passes through all objects in the site, > and deletes any local roles of the to-be-deleted-user. > On a local machine with an older version of the database (7,6GB - 1,2M > objects) the action takes around a minute. > > Problem is (our assumption) that if one of the object changes, > the entire delete action fails and is restarted. > Seeing the site is heavily used, the chances of object changing is very > high. Testing revealed the deletion taking 7 to 8 minutes. > And I was told it fails quite often, I assume a timeout on the entire > action. > > An option would be to not recursively deleted those local roles. > But what concequences will that have? Are they eventually deleted? > Or do they keep lingering around to stab us in the back? > (As in, a new user has the exact username of a previously deleted user, > and suddenly takes over his local roles ..). > > Or what other options would there be? At this time, it's close to > impossbible to delete users.
Assuming you don't have the option of going offline for 10 minutes (or at least disabling writes), you might try modifying Alec M's awesome catalog clear script for plone.org (that attempts to handle conflicts gracefully) to do what you want. http://svn.plone.org/svn/plone/Products.PloneOrg/trunk/scripts/catalog_rebuild.py I'd also copy (and fix, as needed) the code from Products.CMFCore-2.1.2-py2.4.egg/Products/CMFCore/MembershipTool.py and include that in your script. Then run the script via: $ bin/instance run remove-users.py > Regards, > Peter Alex -- Alex Clark · http://aclark.net Author — Plone 3.3 Site Administration · http://aclark.net/admin _______________________________________________ Product-Developers mailing list [email protected] http://lists.plone.org/mailman/listinfo/product-developers
