[Zope-dev] CoreSession, ZEO and BerkeleyStorage = CorruptedDataError

Tony McDonald tony.mcdonald@ncl.ac.uk
Tue, 04 Sep 2001 09:32:30 +0100


On 3/9/01 10:00 pm, "Chris McDonough" <chrism@digicool.com> wrote:

> I'm confused... where does BerkeleyStorage come in here?  It appears
> that the data is being saved to a FileStorage named "SessionStorage".
> 
> In any case, this is sort of besides the point... I unfortunately have
> no idea what the problem could be.  CST does not use the ZODB in any
> particularly taxing way.  About the best I can do is recommend that you
> try to put the ZEO server that serves the session data on another system
> and see if the errors continue.  If they do, and the problem is
> reproducible, we can fix it.
> 
> - C

I knew having a 'big brain' on it would help.

Your comments made me look again at the script (in Extensions) that creates
the session storage. This is used by ExternalMount and looks like this

from ZODB.BerkeleyStorage import SleepyStorage
def createSessionDB():
    return ZODB.DB(SleepyStorage('/home/nnle/ZEO_FARM/SessionData.fs'))

Whereas what I had was
from ZODB.FileStorage import FileStorage
def createDB():
    return ZODB.DB(FileStorage('/home/nnle/ZEO_FARM/SessionData.fs'))

Ie not good

Now I can start my ZEO cluster with
% zctl.py start_zeo
And then cd to the other instances of my Zclients and do
% zctl.py start

A netstat -a | grep LISTEN shows the ZEO server and the clients running.

One thing: I find that if SessionData.fs is *not there* when I start up my
ZEO server with
% zctl.py start_zeo
Then it is created anyhow.

I find that when I start ZEO server several __db.* files are created
(__db.001 .. __db.005) in the var directory of that Instance.

However, when I start my ZClients these files are created in the var
directory of *that* Instance as well. *They* are the files that are changed
with CST activity. The file /home/nnle/ZEO_FARM/SessionData.fs shows no
activity at all. A clue methinks?

Part of my zope.conf is
ZEO['ZEO_STORAGES'] = {}
ZEO['ZEO_STORAGES']['main'] = 'StorageConfig:main_storage'
ZEO['ZEO_STORAGES']['session'] = 'StorageConfig:session_storage'

And this is repeated for each Instance (InstanceHome .. InstanceHome5)

My custom_zodb.py is
import ZEO.ClientStorage, os, string

host=os.environ.get('ZEO_SERVER_NAME', '')
port=string.atoi(os.environ['ZEO_SERVER_PORT'])

Storage=ZEO.ClientStorage.ClientStorage(
    (host, port), name='ZEO eGuides', storage='main')

(there's no mention of the SessionData.fs here, should there be?)

And StorageConfig in lib/python/ZEO is:
import ZODB.FileStorage, ZODB.BerkeleyStorage
# Change the filenames to suit your system
main_storage = 
ZODB.FileStorage.FileStorage('/home/nnle/InstanceHome/var/Data.fs')
session_storage = 
ZODB.BerkeleyStorage.SleepyStorage('/home/nnle/ZEO_FARM/SessionData.fs')

The ZEO stuff works really fine without CST, but I have grandiose plans for
that, so I'm *really* loathe to lose it.

Tell me if I'm being a pain and I'll go lurk again...
tone
-- 
Dr Tony McDonald,  Assistant Director, FMCC, http://www.fmcc.org.uk/
The Medical School, Newcastle University Tel: +44 191 243 6140
A Zope list for UK HE/FE  http://www.fmcc.org.uk/mailman/listinfo/zope