[darcs-devel] [issue434] Darcs grief: Issue 274

David Roundy droundy at darcs.net
Thu Apr 19 10:15:23 PDT 2007


On Thu, Apr 19, 2007 at 10:08:45AM -0700, David Roundy wrote:
> On Thu, Apr 19, 2007 at 08:56:57AM -0700, Samuel A. Falvo II wrote:
> > I'm curious to learn how difficult it would be to implement
> > transactional semantics to Darcs?  This would prevent any kind of
> > corruption in the event of any kind of error at all.
> 
> Pretty easy (almost) with the new hashed inventory format.  We don't want
> truly atomic behavior on the pristine cache, as that'd slow darcs down too
> much (and I don't see any way of avoiding this slowdown, short of
> implementing our own journalling filesystem, which would definitely be a
> nice option, but not so easy).

I should mention that transactional semantics in the working directory is
impossible to implement with any guarantees, because there's always the
possibility that halfway through an update someone will change permissions
of some of the working-directory files, or that disk space will be used up,
etc.  I don't believe anything bigger than a single file can be updated
atomically.  I suppose you could create a new directory and rename it over
an existing one, but you wouldn't want that behavior, since it'd mess up
any running programs with that directory as their working directory.
-- 
David Roundy
Department of Physics
Oregon State University


More information about the darcs-devel mailing list