Two quick hits
Recently I ran into a couple of .. issues where customers had either made mistakes or couldn't figure out things.These were issues that I had run into earlier so being slightly annoyed (itch) I decided it was time to do something about it (scratch).
The first was a customer who managed to run a link-checker on their Plone site, and having the link-checker be logged in, which wrecked havoc as a lot of things in Plone can be done by clicking links. So they had well over a thousand transactions done in the course of 4-5 hours. Restoring from backup would've been simple enough but some important changes had been made prior to this "bot attack" so I didn't see reverting to backup as an option.
This is something that has been a problem earlier as well, so I decided to dig a bit into the undo machinery of Zope to see if it could be fixed. And there, after reading a little bit of code I could see that it would be possible to undo things based on a date. So I wrote up a tool in a couple of hours to test this theory and to my pleasurable surprise it worked.
The product-ified version of this fix can be found here
http://products.nidelven-it.no/undoer
it should probably be a part of the Zope core distribution (it's an obvious, useful feature) but I'm too lazy to get it submitted. If someone wants to do it, feel free to do so - I'll slip it under the ZPL or something similar.
Another thing that bugged me was a customer that was using up a lot of diskspace (itch) (which we would have to charge for) but they claimed they weren't adding large objects to the database. So, fair enough - this is something I've dealt with before and I got another idea: use the database export feature to get a readout on which objects in the database were using the space (scratch); the result is here:
http://products.nidelven-it.no/spaceman
a rather cool hack in my opinion, which uses a dummy file to get a count on which objects are taking up space. Turns out something in the customer's system was writing transactions (and often) so a database pack discarding *all* old transactions was all that was needed.
Now, it would be interesting (and fairly easy) to see what's writing all those transactions as well, but that's one for later.
[Permalink] [By morphex] [Zope (Atom feed)] [13 Mar 19:31 Europe/Oslo]