[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: working copy corruption when network connection lost

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2002-01-04 21:40:54 CET

Greg Stein <gstein@lyra.org> writes:

> What we *don't* have is a macro-level commit/rollback of changes to updates
> to the working copy. This is based on the presumption that it is okay for
> some parts of the tree to be newer or older than others. We only require
> consistent/proper metadata.

OK, I can reproduce the problem. I use the following patch

Index: ./subversion/libsvn_wc/get_editor.c
===================================================================
--- ./subversion/libsvn_wc/.svn/text-base/get_editor.c.svn-base Wed Jan 2 19:39:21 2002
+++ ./subversion/libsvn_wc/get_editor.c Fri Jan 4 19:55:32 2002
@@ -331,6 +331,9 @@
   struct handler_baton *hb = baton;
   struct file_baton *fb = hb->fb;
   svn_error_t *err = NULL, *err2 = NULL;
+ int fixme = 0;
+ if (fixme)
+ return svn_error_createf (1, 0, NULL, hb->pool, "forced error");
 
   /* Apply this window. We may be done at that point. */
   err = hb->apply_handler (window, hb->apply_baton);

which allows me to use the debugger to set the fixme flag and simulate
the error I got when the network failed. This allows me to reproduce
the problem using ra_local as well as ra_dav.

Consider a subversion hierarchy with three files

rev 1:
      wc/foo
      wc/bar
      wc/zac

that get moved into a subdirectory

rev 2:
      wc/gan/foo
      wc/gan/bar
      wc/gan/zac

Now if a rev 1 working copy is updated to rev 2, but the update is
interupted while creating wc/gan/bar, then the problem is that the
wc/.svn/entries file has an entry for the gan subdirectory, but the
wc/gan/.svn/entries file has revision 0 for the svn:this_dir entry.
Attempts to use it cause

$ svn st -u

svn_error: #21052 : <Filesystem has no such file>
  file not found: filesystem `/home/pm/repo/db', revision `0', path `gan'

Now one can put a valid revision into the wc/gan/.svn/entries file
which causes the error to go away. However this doesn't really work
because the update has been interrupted before all the wc/gan elements
got created and added to the entries file.

Alternatively one can take the gan entry out of the wc/.svn/entries
file, and remove the wc/gan/.svn subdirectory. This removes the newly
added gan subdirectory from revision control. One could even remove
the wc/gan subdirectory altogether, after all, it is incomplete and
will need to be removed before the update can be tried again other it
will obstruct the update.

Thus I think this is the solution is: the working copy update code
should remove (totally or just from revision control) an added
subdirectory if the update gets interrupted while creating the
subdirectory.

Any comments?

-- 
Philip
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:54 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.