[ZODB-Dev] blobs missing with relstorage and small blob cache dir
Maurits van Rees
m.van.rees at zestsoftware.nl
Mon Feb 28 10:19:03 EST 2011
Hi,
This is with RelStorage 1.5.0-b1, with blob-dir enabled, shared-blob-dir
false and a low blob-cache-size, say 100000 bytes. Using Plone 3.3.5,
plone.app.blob 1.3, plone.app.imaging 1.0.1, but the same is probably
true for non-Plone setups.
Create two images that are stored as blobs. Each should fit within the
blob-cache-size, but the two of them together should be larger. Create
a page that shows both images. Because the cache gets cleared halfway,
one of the images does not get loaded, at least not always; in my
testing only once every two requests does this image fail to load. The
page shows up, but you get a traceback in the logs:
2011-02-28 15:50:35 ERROR ZODB.Connection Couldn't load state for 0x6c6a
Traceback (most recent call last):
File
"/Users/mauritsvanrees/shared-eggs/ZODB3-3.8.6_polling-py2.4-macosx-10.6-i386.egg/ZODB/Connection.py",
line 851, in setstate
self._setstate(obj)
File
"/Users/mauritsvanrees/shared-eggs/ZODB3-3.8.6_polling-py2.4-macosx-10.6-i386.egg/ZODB/Connection.py",
line 916, in _setstate
obj._p_blob_committed = self._storage.loadBlob(obj._p_oid, serial)
File
"/Users/mauritsvanrees/shared-eggs/RelStorage-1.5.0b1-py2.4.egg/relstorage/storage.py",
line 1245, in loadBlob
return self.blobhelper.loadBlob(cursor, oid, serial)
File
"/Users/mauritsvanrees/shared-eggs/RelStorage-1.5.0b1-py2.4.egg/relstorage/blobhelper.py",
line 178, in loadBlob
raise POSException.POSKeyError("No blob file", oid, serial)
POSKeyError: 'No blob file'
I wonder if there is some code that mistakenly throws away the wrong
blob; it should throw away the oldest one I'd think, and not the one
that it just loaded.
The workaround is probably just to not set the blob-cache-size this low.
But I tried this low setting to work around a different problem, which
I will report in a different post.
--
Maurits van Rees
Web App Programmer at Zest Software: http://zestsoftware.nl
Personal website: http://maurits.vanrees.org/
More information about the ZODB-Dev
mailing list