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

Re: The Four Elements of Righteousness

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2002-07-18 21:58:39 CEST

Greg Stein <gstein@lyra.org> writes:

> So... the answer is that *some* kind of record needs to go in right away so
> that a failed commit can clean up the garbaged stuff. However, I am showing
> some ignorance here. Just how does the tmp area get cleaned? Do we simply
> delete all contents before unlocking the directory? Or do we really need to
> leave a log command that identifies the file, and our cleanup goes over the
> log and says "oh. there is a file to toss." ?
> [ iow, I don't know how we cleanup after a failed commit, or when somebody
> runs 'svn cleanup' ]

Currently, log files are opened and written in .svn/tmp/, and when
they are closed they are moved to .svn/ which makes them candidates to
be run. Only log files in .svn/ are ever run, log files that get left
in .svn/tmp/ are ignored.

> If the tmp gets totally cleared all the time, then we might be okay.

tmp gets cleared out when the cleanup command runs, so to guarantee
that it will get cleaned it must be locked. That gets easier if/when
we get the access batons working.

> I'm just a bit shaky about "leaving this thing around to be magically picked
> up later", rather than specifically identifying "hey. there is something
> right *there* to deal with"
> > The important thing is, those wcprop changes can be sitting there in
> > the tmp area and mean absolutely *nothing* until that log item is
> > written. They are in no danger of taking effect until there's
> > something in the log that says to use them. And libsvn_wc will only
> > tack on that log item when it knows it is safe to do so.
> Seems kind of fine, but it is shaky and really depends on *other* behaviors
> in the system to ensure stuff gets cleaned up properly. A specific marker
> about the file's existence is also a marker that it needs to get cleaned.

It certainly needs thought. At present the atomic unit is a single
file, and the move from .svn/tmp/ to .svn/ is what "activates" it.
The atomic nature of a filesystem move guarantees that only complete
log files get run. To guarantee atomic behaviour with two files is
harder. I suppose one could use the presence of the normal log file
in .svn/ as a prerequisite for using a wcprops log file.

An alternative would require the access batons in place. Then a
single log file could be used, with the access baton caching the log
file handle. This log file could then accumulate actions until such
time as it was run, either explicitly or when the access baton is

Philip Martin
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Jul 18 21:59:14 2002

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.