Bugs with rich-root-packs

John Arbash Meinel john at arbash-meinel.com
Wed Mar 19 22:46:59 GMT 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Alexander Belchenko wrote:
| It seems like today (at least in bzr 1.2 and 1.3rc1 problem exists)
| upgrade to rich-root/rich-root-packs format is completely broken.
|
|     https://bugs.launchpad.net/bugs/177874
|     https://bugs.launchpad.net/bzr/+bug/202884
|     https://bugs.launchpad.net/bzr/+bug/203607
|
| I'm inclined to mark these bugs as critical. What core guys think about it?
|
|

By hacking in a bit of path awareness into the KnitGraphIndex code (I'm
including the diff), I can see that it is indeed TREE_ROOT causing problems, so
it seems like it is bug 177874.

Specifically, the error is:
bzr: ERROR: Revision {('mbp at sourcefrog.net-20050711054655-47ea25e1f75a8813',)}
not present in
"<KnitGraphIndex(CombinedGraphIndex(<bzrlib.index.InMemoryGraphIndex object at
0x021D2B30>) file_id:TREE_ROOT)>".

So I'm not sure if it should be creating the nodes at that point, since it is
the InMemoryGraphIndex which is failing.

I don't know that these are release blocking bugs, as I would guess this isn't a
regression. It *is* something that needs to be fixed before we make rich roots a
default. (Which was discussed at the sprint, at least a --pack-1.3 which is
rich-root-pack with a couple small updates.)

John
=:->


=== modified file 'bzrlib/knit.py'
- --- bzrlib/knit.py      2008-03-15 10:01:28 +0000
+++ bzrlib/knit.py      2008-03-19 22:32:18 +0000
@@ -1657,7 +1657,8 @@
~ class KnitGraphIndex(object):
~     """A knit index that builds on GraphIndex."""

- -    def __init__(self, graph_index, deltas=False, parents=True, 
add_callback=None)
+    def __init__(self, graph_index, deltas=False, parents=True,
+                 add_callback=None, path_hint=None):
~         """Construct a KnitGraphIndex on a graph_index.

~         :param graph_index: An implementation of bzrlib.index.GraphIndex.
@@ -1667,15 +1668,23 @@
~             [(node, value, node_refs), ...]
~         :param parents: If True, record knits parents, if not do not record
~             parents.
+        :param path_hint: If not None, used to help give hints in exceptions
~         """
~         self._graph_index = graph_index
~         self._deltas = deltas
~         self._add_callback = add_callback
~         self._parents = parents
+        self._path_hint = path_hint
~         if deltas and not parents:
~             raise KnitCorrupt(self, "Cannot do delta compression without "
~                 "parent tracking.")

+    def __repr__(self):
+        path_hint = self._path_hint
+        if path_hint is None:
+            path_hint = 'unknown'
+        return '<%s(%s)>' % (self.__class__.__name__, path_hint)
+
~     def _get_entries(self, keys, check_present=False):
~         """Get the entries for keys.


=== modified file 'bzrlib/repofmt/pack_repo.py'
- --- bzrlib/repofmt/pack_repo.py 2008-03-14 10:55:37 +0000
+++ bzrlib/repofmt/pack_repo.py 2008-03-19 22:43:26 +0000
@@ -1058,7 +1058,8 @@
~             add_nodes_callback=self.new_pack.text_index.add_nodes)
~         knit_index = KnitGraphIndex(file_id_index,
~             add_callback=file_id_index.add_nodes,
- -            deltas=True, parents=True)
+            deltas=True, parents=True,
+            path_hint=file_id_index._transport.abspath(file_id_index._name))
~         output_knit = knit.KnitVersionedFile('reconcile-texts',
~             self._pack_collection.transport,
~             None,
@@ -1702,7 +1703,8 @@
~         # setup knit specific objects
~         knit_index = KnitGraphIndex(
~             self.repo._pack_collection.revision_index.combined_index,
- -            add_callback=add_callback)
+            add_callback=add_callback,
+            path_hint=self.repo._pack_collection.revision_index.combined_index)
~         self.repo._revision_knit = knit.KnitVersionedFile(
~             'revisions', self.transport.clone('..'),
~             self.repo.control_files._file_mode,
@@ -1720,7 +1722,8 @@
~         # setup knit specific objects
~         knit_index = KnitGraphIndex(
~             self.repo._pack_collection.signature_index.combined_index,
- -            add_callback=add_callback, parents=False)
+            add_callback=add_callback, parents=False,
+            path_hint=self.repo._pack_collection.signature_index.combined_index)
~         self.repo._signature_knit = knit.KnitVersionedFile(
~             'signatures', self.transport.clone('..'),
~             self.repo.control_files._file_mode,
@@ -1769,7 +1772,9 @@
~             (file_id, ), 1, add_nodes_callback=add_callback)
~         knit_index = KnitGraphIndex(file_id_index,
~             add_callback=file_id_index.add_nodes,
- -            deltas=True, parents=True)
+            deltas=True, parents=True,
+            path_hint=(repr(self.repo._pack_collection.text_index.combined_index)
+                           + ' file_id:' + str(file_id)))
~         return knit.KnitVersionedFile('text:' + file_id,
~             self.transport.clone('..'),
~             None,
@@ -1809,7 +1814,8 @@
~         # setup knit specific objects
~         knit_index = KnitGraphIndex(
~             self.repo._pack_collection.inventory_index.combined_index,
- -            add_callback=add_callback, deltas=True, parents=True)
+            add_callback=add_callback, deltas=True, parents=True,
+            path_hint=self.repo._pack_collection.inventory_index.combined_index)
~         return knit.KnitVersionedFile(
~             'inventory', self.transport.clone('..'),




-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFH4ZfjJdeBCYSNAAMRAoQrAJ0VGxc2x5kLq+RPE+r/yc1bJ2rEDACeK3wM
VijS53bSno9rtnDt7AE8YnU=
=uwBO
-----END PGP SIGNATURE-----



More information about the bazaar mailing list