[ZODB-Dev] [Errno 27] File too large

Jim Fulton jim@zope.com
Tue, 25 Sep 2001 18:42:46 -0400


Jeremy Hylton wrote:
> 
> >>>>> "CW" == Chris Withers <chrisw@nipltd.com> writes:
> 
>   CW> Jeremy Hylton wrote:
>   >>
>   >> I am fairly certain this is true.  (Only fairly certain because
>   >> I'm not familiar enough with the FileStorage internals.)  Is this
>   >> behavior the bug you reported?  I don't think a storage makes any
>   >> guarantees about the amount of disk space used by an aborted
>   >> transaction.
> 
>   CW> Would I be particularly out of order in stating that this
>   CW> appears to be a shocking oversight in FileStorage?

You wouldn't be out of order, but I wouldn't agree with you in the abstract.

This specifica case is a pretty bad bug.

> I don't think it's an oversight; I'm not at all surprised that it
> works this way.

It *is* a bug.  I think that the intent was to truncate the file before
the aborted transaction. The truncate in _abort is truncating at the
existing end of file.  It looks to me like _abort should be:

    def _abort(self):
        if self._nextpos: 
            self._file.truncate(self._pos)
            self._nextpos=0

> I assume that a pack removes this data.  If it doesn't, then that's a
> shocking oversight. 

It does, but it throws away any subsequent transactions. The same
thing happens on startup.  This is pretty serious. Fortunately, this
kind of failure should be extremely rare.

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