[ZODB-Dev] Re: [Zope-dev] ZEO, FileStorage, and Undo

Toby Dickenson tdickenson@geminidataloggers.com
Wed, 21 Aug 2002 16:05:22 +0100


On Wednesday 21 Aug 2002 2:45 pm, Florent Guillaume wrote:

> > So I wrote a patch for undoLog in FileStorage to batch by days instea=
d of
> > # of transactions. This lets us show batches of 2 days at a time inst=
ead
> > of 20 transactions. Thus we never have to search more than 2 days wor=
th
> > of the database. I also MonkeyPatched the manage_UndoForm in
> > App.UndoSupport.

I use a similar system in DirectoryStorage which enforces a configurable=20
timeout on the history scanning process.

> > While doing this I noticed that at the beginning of undoLog FileStora=
ge
> > acquires a lock (_lock_acquire). Is this necessary if it's only doing
> > reads?

In the current implementation, yes. That lock is also taken by other read=
-only=20
methods such as load().

I think you are correct to suspect that a less aggressive locking policy=20
should be possible.

> > Any suggestions? Is there a way to lock only for writes? So that page=
s
> > can still be served?

DirectoryStorage is the only storage I am aware of that doesnt have a big=
=20
lock. It is still at alpha release, so I wouldnt recommend using it in=20
production yet.

http://dirstorage.sourceforge.net/