Revfile vs Atomicity & Dumbfs

Martin Pool mbp at sourcefrog.net
Tue May 10 00:40:53 BST 2005


On  9 May 2005, John A Meinel <john at arbash-meinel.com> wrote:

> Although, I think the clone-and-replace method gets around this, since
> it already has to break hardlinks, but would preserve ones that haven't
> changed.

We can certainly do copy-append if we don't trust that just appending
to a revfile will be safe, but I don't see how that can ever occur.

I don't see why you would ever want to hardlink-and-replace the whole
.bzr directory; it's enough to write in new objects bottom-up because
they only become visible when they're only referenced by something
else.  Making the new revision the head makes the whole transaction
visible.

If the process is interrupted while writing to a revfile the following
conditions can occur:

- text file contains data not referenced by the index - harmless, can
  be vacuumed up later if you really want

- index line is written

- index line is not written

If the whole machine crashes or suffer power failure then there are
more possibilities:

- existing data in the files is corrupted; get a better filesystem; or
  use copy-then-append mode

- the index line is corrupted; this can be detected and this
  particular revision of the file is lost but nothing else; that last
  revision may need to be removed.

- the text file is corrupted; likewise

-- 
Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050510/66ec2bdd/attachment.pgp 


More information about the bazaar mailing list