[ZODB-Dev] ZEO.ClientStorage replication: invalidations don't work

Mihai Ilinca muqker at muqker.com
Thu Jan 26 08:10:17 EST 2006


Hi.

I am trying to have a ZODB.DB accessible from remote locations trough 
ZEO.ClientStorage . I want the remote clients to also be able to work 
disconnected (by enabling ClientStorage's local caching).

The problem is that changes made in one place do not show up in any other 
places (trough the Invalidation system) unless I stop and restart the scripts 
in those other places. This happens in connected mode (when connections ARE 
possible between the Clients and the Server).

Ok, in more detail: 
I have the server:

runzeo.py -a 1.2.3.4:7895 -f /path/data.fs

running on one machine

And I have 2 types of clients running on other machines:

main = ClientStorage.ClientStorage(
                                            1.2.3.4,
                                            name='main',
                                        )

slave = ClientStorage.ClientStorage(
                                1.2.3.4,
                                name = 'some-per_client_unique-name',
                                client = 'some-per_client_unique-name',
                                var = 'data',
                                wait = False,
                            )

Trough 'slave' I only do read operations at the moment. If I make changes to 
the stored data trough the 'main' client, the 'slave' clients don't see it. 
They only see the data as it was when the ClientStorage was constructed. If I 
restart a 'slave' (the class gets constructed again), the changes are 
visible. Basically, it's like having no Invalidation system whatsoever.

What am I doing wrong here?

Oh, and btw, one other thing: _sometimes_, if runzeo.py is stopped, neither 
the 'main' nor the 'slave' client will start. It's understandable for 'main' 
because it is not configured to use a cache, but how about 'slave' that 
should work in disconnected mode also. I can't seem to always replicate this. 
Sometimes they simply work. When they don't, they raise the exception:
[...]
return node.dump() #my code; node is an instance of PersistentMapping
 File 
"/home/packages/devel/binary/zodb/zodb3-3.4.0/debian/python2.4-zodb3/usr/lib/python2.4/site-packages/ZODB/Connection.py",
 line 704, in setstate
 File 
"/home/packages/devel/binary/zodb/zodb3-3.4.0/debian/python2.4-zodb3/usr/lib/python2.4/site-packages/ZODB/Connection.py",
 line 742, in _setstate
 File 
"/home/packages/devel/binary/zodb/zodb3-3.4.0/debian/python2.4-zodb3/usr/lib/python2.4/site-packages/ZEO/ClientStorage.py"
 , line 746, in load
 File 
"/home/packages/devel/binary/zodb/zodb3-3.4.0/debian/python2.4-zodb3/usr/lib/python2.4/site-packages/ZEO/ClientStorage.py"
 , line 769, in loadEx
 File 
"/home/packages/devel/binary/zodb/zodb3-3.4.0/debian/python2.4-zodb3/usr/lib/python2.4/site-packages/ZEO/ClientStorage.py"
 , line 79, in __getattr__
 ZEO.Exceptions.ClientDisconnected

Can you give me a hint?
Thanks.

-Mihai


More information about the ZODB-Dev mailing list