On Mon, Jan 7, 2013 at 1:20 PM, Claudiu Saftoiu <csaft...@gmail.com> wrote:
>> > I'm afraid this doesn't seem to help me figure out what's wrong...
>> I suspect your database is corrupted. You'd probably want to look at
>> the record in question to be sure.
> Sure, I've re-run the pack and will dump the pickled object to a file to
> inspect it - is that what you meant? (How else would I figure out what the
> record is?)
Yes. Exactly how you do this depends on your level of expertise, I'm afraid.
Also, knowing the position in the file where this record is stored.
>> You could disable garbage collection, but if you have a damaged
>> record, you might want to use the previous version of the record
>> (if it exists) to recover it.
> What do you mean by disable garbage collection - you mean disable removing
> old versions of records that are no longer used? I can't do that
> unfortunately, the database gets too large.
Packing involves 2 operations:
- Removing old versions of objects.
- Garbage collection: removing objects that are no-longer reachable
from the root.
Garbage collection requires un-pickling database records.
You can disable garbage collection by including:
in your filestorage tag in your zeo.conf file.
This would allow the pack to proceed, and probably free up lots of
space, but would remove old object versions that you might
wish you had to recover a damaged record.
> How would I go about attempting to find the previous version of the record?
File-storage database records have a previous-record field
that gives the file position of the previous version of an object, if any.
> If I know what the record is I can just decide whether to let it be lost -
> would catching the TypeError and 'pass'ing accomplish that?
That's probably not the only error that can be raised. Also, if the
damaged record held the only references to lots of other objects,
you'd potentially lose more objects through garbage collection.
The first step is to find out if the record is really damaged.
Maybe make a back up of your database if you can and then
pack without garbage collection to free up space while you
figure out what's wrong with your data.
Jerky is better than bacon! http://zo.pe/Kqm
For more information about ZODB, see http://zodb.org/
ZODB-Dev mailing list - ZODB-Dev@zope.org