[Zope] Backing Up Zope (was: Re: [Zope] Data.fs.lock?)

Shane Hathaway shane@digicool.com
Thu, 29 Jun 2000 17:19:32 -0400


"Jeff K. Hoffman" wrote:
> 
> On Thu, 29 Jun 2000, Erik Enge wrote:
> 
> > On Thu, 29 Jun 2000, Jeff K. Hoffman wrote:
> >
> > > It is my understanding that the ZODB on disk is always in a consistent
> > > state; Jim has said, in the past, that you can simply make a copy of
> > > Data.fs, even while Zope is running, without problems.
> >
> > But the Data.fs has to be updated sometimes.  And if you read from a file
> > that is changing, the integrity of your data isn't.  How can you make sure
> > that the file is not written to during a certain period of time?  You
> > can't?
> 
> Now that I'm in the spotlight I can't seem to find the message I was
> referring to in the archives; I sure hope I didn't misquote anyone (i.e.
> Jim).
> 
> Unfortunately, I don't have an answer to your question. I still believe I
> am correct, but cannot tell you, technically, why. I have some theories,
> but I don't want to cloud the issue anymore with my hypotheses.
> 
> Let's hope someone who does know chimes in.

Quite simply, Data.fs is appended, not modified, except during a pack
operation.  Think of it like a binary log file.  Therefore there are
only two ways a simple, live backup of Data.fs can fail:

1) You do the copy in the middle of a pack operation.  For most,
packing is a rare operation.  But if this happened, your backup would
be worthless.

2) You get a partly truncated record at the very end.  This is actually
not a big deal, and AFAIK in most cases ZODB is capable of
automatically rolling back a partially committed transaction.

Shane