[ZODB-Dev] ZEO, FileStorage, and Undo
Jim Fulton
jim@zope.com
Thu, 22 Aug 2002 12:01:17 -0400
Jeremy Hylton wrote:
> >> brinegar@purdue.edu wrote: Hello,
...
> >> So I wrote a patch for undoLog in FileStorage to batch by days
> >> instead of
> >> # of transactions. This lets us show batches of 2 days at a time
> >> # instead
> >> of 20 transactions. Thus we never have to search more than 2 days
> >> worth of the database. I also MonkeyPatched the manage_UndoForm
> >> in App.UndoSupport.
That's a good idea, but even showing one day's worth could take a lot of
time on busy systems.
...
> >> We have a ZEO with 3 Zeo Clients and 1 Zeo Server when someone
> >> hits Undo the Zeo Server locks and all 3 clients sit waiting. It
> >> appears from experience as a user that_lock_acquire locks reads
> >> and writes.
>
> Yes. It's really a shame that this behavior locks up the ZEO server
> and prevents anyone else from making progress. I've discussed this a
> few times as a worry, but I've never heard complaints about it in real
> life. Well-- make that I had never heard until now.
I've complained about it. ;)
> >> We have a system with potential for thousands of content
> >> maintainers. It is undesirable to have our entire site die for 20
> >> seconds everytime one of them clicks "Undo". We could disable
> >> Undos, however the transactional database was one of the reasons
> >> we choose Zope.
> >>
> >> Any suggestions? Is there a way to lock only for writes? So that
> >> pages can still be served?
>
> I think we could change the search process so that acquire and
> released the lock for each transaction. That might make the undo a
> lot slower, but it would also allow other threads to make progress
> while undoLog() is running. To implement this, we'd need to modify
> FileStorage to change its lock behavior and ZEO to run undoLog() in a
> separate thread. These both sound easy.
Sounds good.
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