[RFC] Knit data should track ancestry

John Arbash Meinel john at arbash-meinel.com
Tue Aug 29 17:41:40 BST 2006


I think in our next format change, we should modify the '.knit' files so
that they contain the ancestry information, on top of the values saved
in the .kndx files.

The biggest reason for this is corruption recovery. As it stands, if I
delete the '.kndx' file, I can no longer understand the contents of the
'.knit' file. If only because I no longer understand what each delta
should be applied against.

By just adding a single basis field, we can at least reconstruct any
given text. And since the sha hash is in the data file, we can check
that it is valid. I suppose right now would have a reasonable guess as
to what parents it *could* be, and just start trying them until the sha1
matches. But that is pretty ugly.

But if we add a full list of parents, we have the advantage that we can
completely regenerate the ancestry from only the .knit files. And the
.kndx files become a pure lookup optimization, rather than containing
critical information.

We already have a start and end marker for every .knit hunk. And it is
somewhat likely that the parent id is already part of some of the knit
hunk annotations, so it shouldn't increase the compressed size by a
whole lot. (At least in the case of a merge, maybe not as likely when
you only have a single parent).

I was just thinking about some disaster recovery scenarios, and it seems
like it would be nice to be able to reconstruct your data as long as you
had the texts and deltas. It seems a shame to lose everything just
because you lost the .kndx file. We have 99% of the information we need
in the .knit, if we put the extra 1% in there, we have a more robust system.

I realize this is an incompatible format upgrade, but I think it is
worth keeping in mind as we design the next format.

John
=:->

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060829/1300b5ac/attachment.pgp 


More information about the bazaar mailing list