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

heads-up: restartable checkouts

From: Ben Collins-Sussman <sussman_at_collab.net>
Date: 2003-05-09 22:42:09 CEST

I've "picked up the ball" on issue #730 -- restartable checkouts --
from Hadaka, with his permission. I've spent a couple of days mulling
over the problem, reading all of Nuutti's notes, reading email
threads. Then I discussed the problem with kfogel, cmpilato, gstein,
and jackr in front of a whiteboard; as a group, we came up with a good
solution that we're all happy with. On IRC, I explained the solution
to mbk and sander, and they're happy with it too. I *hope* that's
enough of a consensus to get moving. :-)

Anyway, I'm relaying the strategy here, so nobody is caught by
surprise:

1. Instead of '0', create '-1' revnums when creating a fresh entries
   file containing only THIS_DIR. (This is part of init_adm_area(), I
   believe.)

2. Modify update_editor.c:add_directory() create a link in its
   parent's entries file immediately, rather than having
   close_directory() do that. close_directory() still will retain its
   job of changing the directory's revnum from -1 to something valid.

These two initial changes are goodness: it means that incomplete
entries files are now linked in their parent directories, so that an
update-crawler can see them.

3. On the server side, teach the libsvn_repos reporter functions to
   notice a invalid revnum (-1) passed into set_path() and
   link_path(). Rather than freak out, do any necessary linkage in
   the txn and then *remove* all children of the new directory.

4. On the client side, allow the update-crawler to report unfinished
   directories as being at revision -1; this puts the crawler into a
   new "low confidence" mode, akin to CVS. Normally, the crawler
   assumes the entries file is complete, and thus only reports
   anomalous children, because client/server have a shared
   understanding of what 'directory version N' means. But in this
   "low confidence" mode, the client believes the entries file is
   incomplete, and a) assumes the server has created an empty
   directory, and b) unconditionally reports *all* children that it
   sees in the entries file to the server.

In this new design, running 'svn up' in an working-copy of an
interrupted checkout will be able to successfully report on both
finished and unfinished entries files, complete the crawl, and receive
the tree delta from the server.

This solution also has a nice property: no compatibility headaches.
We don't need to change network protocols one whit. An old client
will still choke on an unfinished entries file claiming to be revision
0 or -1. An old server will still choke whenever a 0 or -1 is passed
into set_path(). In other words, nothing can get worse. If either
client or server are old, checkouts continue to be un-restartable.
But if client and server are both new, then 'svn up' can finish the
checkout using the low-confidence reporting technique on unfinished
entries files.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri May 9 22:43:14 2003

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.