Rev 36: Workaround for bug of generating a empty internal node from time to time. in http://people.ubuntu.com/~robertc/baz2.0/plugins/index2/trunk

Robert Collins robertc at robertcollins.net
Mon Jul 14 14:50:19 BST 2008


At http://people.ubuntu.com/~robertc/baz2.0/plugins/index2/trunk

------------------------------------------------------------
revno: 36
revision-id: robertc at robertcollins.net-20080714135018-xu35fmg5ivjtnlbx
parent: robertc at robertcollins.net-20080714131017-yzik8lo3yucc5zhr
committer: Robert Collins <robertc at robertcollins.net>
branch nick: trunk
timestamp: Mon 2008-07-14 23:50:18 +1000
message:
  Workaround for bug of generating a empty internal node from time to time.
modified:
  btree_index.py                 index.py-20080624222253-p0x5f92uyh5hw734-7
=== modified file 'btree_index.py'
--- a/btree_index.py	2008-07-14 13:10:17 +0000
+++ b/btree_index.py	2008-07-14 13:50:18 +0000
@@ -1012,6 +1012,10 @@
                 #             bloom_hits[1] += 1
                 #             bisect.insort(missing_keys, sub_key)
                 #     sub_keys = remaining_sub_keys
+                if not node.keys:
+                    # Empty node - rare bug in the generator, but it means all
+                    # keys are missing.
+                    continue
                 positions = self._multi_bisect_right(sub_keys, node.keys)
                 node_offset = next_row_start + node.offset
                 next_nodes_and_keys.extend([(node_offset + pos, s_keys)




More information about the bazaar-commits mailing list