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

Jeremy Hylton jeremy@zope.com
Tue, 25 Sep 2001 11:45:10 -0400 (EDT)


>>>>> "CW" == Chris Withers <chrisw@nipltd.com> writes:

  CW> BTW, I'm pretty sure this is once again exhibiting a bug I
  CW> reported earlier.

  CW> When you abort from within a transaction, it appears that the
  CW> contents of the transaction still get appended to the end of
  CW> Data.fs, they just don't show up as the current version.

  CW> Can anyone tell me this is/isn't true and tell me how I can
  CW> check this?

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.

Once a transaction gets to the tpc_vote() stage, all the data is
copied into place at the end of the Data.fs.  It needs to be copied
there, because it can't vote yes for the transaction until it can
guarantee that it won't fail because of I/O issues.

When tpc_finish() is called, a flag is set marking the transaction as
commited.  If tpc_abort() is called, the flag isn't set.  So in either
case, the data sits on disk.

If you want to review the behavior yourself, take a look at
FileStorage.py.  The tpc_vote() implementation copies all the data out
of the temporary buffer.  The tpc_abort() call merely calls truncate()
on the Data.fs; since it follows the tpc_vote() call, the file pointer
point just after the transaction's data.

Jeremy