[ZODB-Dev] ZEO/Zope unexpected behaviour
Jim Fulton
jim@zope.com
Mon, 18 Mar 2002 11:19:49 -0500
Toby Dickenson wrote:
>
> I have just upgraded one zeo-based zope cluster from zope 2.4.x to the
> current CVS. Some intermediate version has added the need for a temp_folder
> object in Zopes root folder; this object is added if needed in
> OFS.Application.initialize.
>
> This cluster has three zope clients. Everything was as expected when bringing
> up the first client. However strange things happened when bringing up
> the second and third clients.
>
> When bringing up the second client, I saw the following traceback:
> 2002-03-18T13:35:15 PANIC(300) z2 Startup exception
> Traceback (innermost last):
> File /home/cedarmaster/app2/Zope2/z2.py, line 526, in ?
> File <string>, line 1, in ?
> File
> /home/cedarmaster/replicated/versions/Zope-day1/lib/python/Zope/__init__.py,
> line 71, in ?
> File
> /home/cedarmaster/replicated/versions/Zope-day1/lib/python/OFS/Application.py,
> line 273, in initialize
> (Object: Zope)
> File
> /home/cedarmaster/replicated/versions/Zope-day1/lib/python/ZODB/Transaction.py,
> line 238, in commit
> File
> /home/cedarmaster/replicated/versions/Zope-day1/lib/python/ZODB/Connection.py,
> line 280, in commit
> ConflictError: database conflict error (oid 0000000000000001, class
> OFS.Application.Application)
>
> It appears that this second Zope client believed the root folder still did
> not contain the temp_folder object. I assume it was using and old version of
> the root folder object from its client cache. This is confirmed by trying
> bring this client up for a second time: everything works, because the first
> ConflictError has removed the object from the client cache.
>
> Some questions:
>
> 1. Should this startup code catch ConflictError and retry?
I suppose it should. Ugh.
> I guess ideally it
> should, but I dont see any major problem to not doing so.
This is another case where things happening implicitly cause problems. :(
I'm increasingly convinced that we should avoid these kinds of implicit
changes, although I'm unsure how best to avoid them.
> 2. Doesnt ClientStorage validate every object in its cache before allowing
> any data methods to be called (provided wait_for_server_on_startup is not
> unset) ?
No, it just waits for a successful connection before proceeding. It invokes verification, but doesn't wait for validation. Maybe it should.
> Have I misunderstood how this is supposed to work?
Well, you may understand how it should work.
> Is it worth me investigating further?
Hm. If you are up for trying to make handling conflict errors in
the startup code better, than I'm all for it. ;) A work around
for a case like this would be to remove the cache files before
starting.
Jim
--
Jim Fulton mailto:jim@zope.com Python Powered!
CTO (888) 344-4332 http://www.python.org
Zope Corporation http://www.zope.com http://www.zope.org