[brisbane-core MERGE/RFC] InternalNode.iteritems() broken

John Arbash Meinel john at arbash-meinel.com
Fri Mar 6 20:26:49 GMT 2009


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

Ian Clatworthy wrote:
> It's taken several hours but I've finally tracked down why
> path2id() was returning None for some import data streams
> but not others. It seems that the moment the parent_id_basename_to_file_id
> CHKMap overflows from one node to several, the children
> property suddenly becomes [] because iteritems() on the
> root_node was invoking the InternalNode method, not the LeafNode
> one! I suspect this bug was the one causing me lots of
> grief last week w.r.t. bzr ls -r-1 coming up empty on some
> trees but not others.
> 
> Anyhow, I've attached a simple workaround patch until someone smarter
> than me can find the deeper bug.
> 
> Ian C.
> 
> 

I worked it out.

The issue was with "_search_prefix_filter()".  Specifically when you
search for just a prefix of the total key (file_id,*) rather than a
specific (file_id, revision_id). It was using the raw key, rather than
applying the search_key_func() over it.

Can you verify that revno 3851 fixes this for you?

Also, your original change could definitely be part of the slowdown.
Because if you don't pass a key filter to _iter_nodes, then when it
iterates the children, they will iterate all of *their* children, etc.
Which means it has to page in the whole inventory structure.

John
=:->

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

iEYEARECAAYFAkmxhwkACgkQJdeBCYSNAAN+qQCgnDl+kZzTznEmnwM40GdbELVv
Z70AnjZWdZdAPTG5bvBmTy8Qs8XMSlVf
=ePcB
-----END PGP SIGNATURE-----



More information about the bazaar mailing list