You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Karl Fogel <kf...@red-bean.com> on 2008/02/04 06:05:40 UTC

Re: [Issue 2992] fsfs svnadmin recover may leave repository in a broken state

blair@tigris.org writes:
> This feature is not in 1.4, it's new code in 1.5.
>
> I do think it should be pulled since it may leave a false impression
> that you have a good repository.

[I've moved discussion from the issue tracker to the mailing list.]

Blair is talking about having 'svnadmin recover' work on FSFS
repositories.  Background: I recently applied Jeremy Whitlock's patch
for issue #2992, which made FSFS recovery do better error checking.

But Blair argues above, and in more detail in the issue, that we
should not have a recovery feature for FSFS repositories at all.

I (tentatively) think we should.  The final three things an FSFS
commit does are, in order:

   - write the 'revs/FOO' file (atomically)
   - write the 'revprops/FOO' file (atomically)
   - write the 'current' file (atomically)

If recovery sees both 'revs/FOO' and 'revprops/FOO', it can recreate
'current'.  Given that the vast majority of non-svn-aware backup
programs will work by just copying everything in no particular order,
then it will sometimes happen that a repository will be missing
everything but 'current'.  In that case, we can recover and should;
and if we're missing more than just 'current', recovery should fail,
(which is what Jeremy's patch for issue #2992 ensures).

So with that patch applied, I think FSFS recovery is both useful (for
the race-condition case) and safe (in other cases, recovery will fail,
which is what we want).

One could argue that merely offering the feature creates a "moral
hazard" -- that admins will think any old backup tool is fine, because
the repository can always be recovered.  But they won't think that for
very long, once they discover that not everything can recovered from,
and we can help that by documenting it.  It seems to me that if we
have an easy way to fix one particular kind of repository breakage, we
should offer it.

[None of this affects the correctness of Jeremy's patch.  If we remove
the feature, then his patch goes away along with the code it applied
to.  Therefore, I've resolved issue #2992; what we're having now is a
separate discussion.]

-Karl

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [Issue 2992] fsfs svnadmin recover may leave repository in a broken state

Posted by Branko Čibej <br...@xbc.nu>.
Dan Christian wrote:
> The issue isn't crashes, it's backups.  current was written and the
> user responded to, but the backup was written with an older version of
> current.
>   

How can you tell the difference just by looking at the FSFS tree?

-- Brane


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [Issue 2992] fsfs svnadmin recover may leave repository in a broken state

Posted by "Ph. Marek" <ph...@bmlv.gv.at>.
On Dienstag, 5. Februar 2008, Karl Fogel wrote:
> Blair Zajac <bl...@orcaware.com> writes:
> > Karl Fogel wrote:
> >> Blair Zajac <bl...@orcaware.com> writes:
> >>> Chances are the current file will be up to date but the rev and
> >>> revprops directories will not be backed up completely if the backup
> >>> program works in alphabetical order.
> >>
> >> How can that happen?  'current' isn't written until after revs/FOO and
> >> revprops/FOO are fully written.
> >
> > Doh, too early in the morning to send email :)
>
> Hah!  I'm *so* enjoying having the East Coast advantage in these
> discussions (not that I can even begin to compete with our European
> colleagues in that department...)
Then again we're already tired *again* when you guys get up :-)


Regards,

Phil

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [Issue 2992] fsfs svnadmin recover may leave repository in a broken state

Posted by Karl Fogel <kf...@red-bean.com>.
Blair Zajac <bl...@orcaware.com> writes:
> Karl Fogel wrote:
>> Blair Zajac <bl...@orcaware.com> writes:
>>> Chances are the current file will be up to date but the rev and
>>> revprops directories will not be backed up completely if the backup
>>> program works in alphabetical order.
>>
>> How can that happen?  'current' isn't written until after revs/FOO and
>> revprops/FOO are fully written.
>
> Doh, too early in the morning to send email :)

Hah!  I'm *so* enjoying having the East Coast advantage in these
discussions (not that I can even begin to compete with our European
colleagues in that department...)

-Karl

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [Issue 2992] fsfs svnadmin recover may leave repository in a broken state

Posted by Blair Zajac <bl...@orcaware.com>.
Karl Fogel wrote:
> Blair Zajac <bl...@orcaware.com> writes:
>> Chances are the current file will be up to date but the rev and
>> revprops directories will not be backed up completely if the backup
>> program works in alphabetical order.
> 
> How can that happen?  'current' isn't written until after revs/FOO and
> revprops/FOO are fully written.

Doh, too early in the morning to send email :)

Blair

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [Issue 2992] fsfs svnadmin recover may leave repository in a broken state

Posted by Karl Fogel <kf...@red-bean.com>.
Blair Zajac <bl...@orcaware.com> writes:
> Chances are the current file will be up to date but the rev and
> revprops directories will not be backed up completely if the backup
> program works in alphabetical order.

How can that happen?  'current' isn't written until after revs/FOO and
revprops/FOO are fully written.

-K

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [Issue 2992] fsfs svnadmin recover may leave repository in a broken state

Posted by Blair Zajac <bl...@orcaware.com>.
Chances are the current file will be up to date but the rev and revprops 
directories will not be backed up completely if the backup program works in 
alphabetical order.

Blair

Dan Christian wrote:
> The issue isn't crashes, it's backups.  current was written and the
> user responded to, but the backup was written with an older version of
> current.
> 
> -Dan C
> 
> On Mon, Feb 4, 2008 at 9:22 AM, David Glasser <gl...@davidglasser.net> wrote:
>>  I haven't had a chance to read the rest of this issue/thread, but:
>>
>>  FSFS is pretty clear on this point.  Crashing between moving
>>  revprops/FOO into place and moving current into place is quite
>>  possible.  However, the semantics there are also very well defined:
>>  the commit *didn't happen*.  If current hasn't been updated, then the
>>  commit hasn't happened yet; no user should have been told that that
>>  revision was committed successfully; etc.  I don't see why we should
>>  add "recovery" code that makes it look like a commit has happened when
>>  it never did!
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [Issue 2992] fsfs svnadmin recover may leave repository in a broken state

Posted by Dan Christian <dc...@google.com>.
The issue isn't crashes, it's backups.  current was written and the
user responded to, but the backup was written with an older version of
current.

-Dan C

On Mon, Feb 4, 2008 at 9:22 AM, David Glasser <gl...@davidglasser.net> wrote:
>  I haven't had a chance to read the rest of this issue/thread, but:
>
>  FSFS is pretty clear on this point.  Crashing between moving
>  revprops/FOO into place and moving current into place is quite
>  possible.  However, the semantics there are also very well defined:
>  the commit *didn't happen*.  If current hasn't been updated, then the
>  commit hasn't happened yet; no user should have been told that that
>  revision was committed successfully; etc.  I don't see why we should
>  add "recovery" code that makes it look like a commit has happened when
>  it never did!

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [Issue 2992] fsfs svnadmin recover may leave repository in a broken state

Posted by David Glasser <gl...@davidglasser.net>.
On Feb 4, 2008 8:35 AM, Blair Zajac <bl...@orcaware.com> wrote:
> Karl Fogel wrote:
> > One could argue that merely offering the feature creates a "moral
> > hazard" -- that admins will think any old backup tool is fine, because
> > the repository can always be recovered.  But they won't think that for
> > very long, once they discover that not everything can recovered from,
> > and we can help that by documenting it.  It seems to me that if we
> > have an easy way to fix one particular kind of repository breakage, we
> > should offer it.
>
> The type of breakage this code is handling is very rare.  When is svn going to
> crash between moving revprops/FOO into place and moving current into place?

I haven't had a chance to read the rest of this issue/thread, but:

FSFS is pretty clear on this point.  Crashing between moving
revprops/FOO into place and moving current into place is quite
possible.  However, the semantics there are also very well defined:
the commit *didn't happen*.  If current hasn't been updated, then the
commit hasn't happened yet; no user should have been told that that
revision was committed successfully; etc.  I don't see why we should
add "recovery" code that makes it look like a commit has happened when
it never did!

--dave


-- 
David Glasser | glasser@davidglasser.net | http://www.davidglasser.net/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [Issue 2992] fsfs svnadmin recover may leave repository in a broken state

Posted by Blair Zajac <bl...@orcaware.com>.
Karl Fogel wrote:
> blair@tigris.org writes:
>> This feature is not in 1.4, it's new code in 1.5.
>>
>> I do think it should be pulled since it may leave a false impression
>> that you have a good repository.
> 
> [I've moved discussion from the issue tracker to the mailing list.]
> 
> Blair is talking about having 'svnadmin recover' work on FSFS
> repositories.  Background: I recently applied Jeremy Whitlock's patch
> for issue #2992, which made FSFS recovery do better error checking.
> 
> But Blair argues above, and in more detail in the issue, that we
> should not have a recovery feature for FSFS repositories at all.
> 
> I (tentatively) think we should.  The final three things an FSFS
> commit does are, in order:
> 
>    - write the 'revs/FOO' file (atomically)
>    - write the 'revprops/FOO' file (atomically)
>    - write the 'current' file (atomically)
> 
> If recovery sees both 'revs/FOO' and 'revprops/FOO', it can recreate
> 'current'.  Given that the vast majority of non-svn-aware backup
> programs will work by just copying everything in no particular order,
> then it will sometimes happen that a repository will be missing
> everything but 'current'.  In that case, we can recover and should;
> and if we're missing more than just 'current', recovery should fail,
> (which is what Jeremy's patch for issue #2992 ensures).

I think most backup programs work in alphabetical order.  Take tar, you'll back 
up current and then descend into revs and then revprops.  So in this case, 
recover should check that current has the corresponding revs/FOO and 
revprops/FOO files and if it doesn't back down current.

The only time where 'svnadmin recover' will do anything with useful consistency 
is if the commit process crashes before it moves current into place.  The 
'svnadmin recover' was added for DBD because DBD supports a recover option to 
handle database crashes and using 'svnadmin dump'.

> So with that patch applied, I think FSFS recovery is both useful (for
> the race-condition case) and safe (in other cases, recovery will fail,
> which is what we want).
> 
> One could argue that merely offering the feature creates a "moral
> hazard" -- that admins will think any old backup tool is fine, because
> the repository can always be recovered.  But they won't think that for
> very long, once they discover that not everything can recovered from,
> and we can help that by documenting it.  It seems to me that if we
> have an easy way to fix one particular kind of repository breakage, we
> should offer it.

The type of breakage this code is handling is very rare.  When is svn going to 
crash between moving revprops/FOO into place and moving current into place?

Regards,
Blair

-- 
Blair Zajac, Ph.D.
CTO, OrcaWare Technologies
<bl...@orcaware.com>
Subversion training, consulting and support
http://www.orcaware.com/svn/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org