[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Wb-discuss] bad block number error

From: Aubrey Jaffer
Subject: Re: [Wb-discuss] bad block number error
Date: Wed, 02 Dec 2009 16:55:46 -0500 (EST)

 | Date: Tue, 24 Nov 2009 15:24:30 +0100
 | From: Floris Ouwendijk <address@hidden>
 | I'm working on an Java application for which I'd like to use WB to
 | store a mapping from a 10 byte key to a 20 byte value.
 | When running some tests I ran into the following error:
 | >>>>ERROR<<<< bad block number 8:272129 (>= 1347)
 | The key is essentially a number, stored with the 8 bytes in little
 | endian order, followed by another 2 byte number. In the test I
 | sequentially store numbers, starting from zero, and the error
 | occurs (consistently) when storing a few tens of thousands values.
 | Some snippets:
 |         Ents.initWb(12, 100, 4096);
 |         btreeSeg = Segs.makeSeg("_index_", 4096);
 |         btree = Han.hanMakeHan();
 |         Segs.btCreate(btreeSeg, Wbdefs.dirTyp, btree, 1);
 |         Handle.btGet(btree, idToKey(id, 1), 10, valueArray);
 |         Handle.btPut(btree, idToKey(id, 1), 10, createValueArray(...), 20);
 | When I reverse the small number and the big number in the key, the
 | system successfully inserts a few million items, but I'm concerned
 | about this behavior.
 | Would anyone have some thoughts on what's up?
 | Any ideas on how to select the values passed to Ents.initWb?

The first argument to initWb() should be much larger.  Try:

  Ents.initWb(100, 100, 4096);


  Ents.initWb(1000, 1000, 4096);

These will allocate about 400.kB or 4.MB for buffers, respectively.

 | What type to choose?

dirTyp is for directory B-trees, those whose value fields are 5.B
pointers to other B-trees.  The wbcheck program frees those B-trees
which are not pointed to by a directory B-tree.

Most B-trees should be indTyp.

 | Is the way I create a Han object correct?


 | Kind regards,
 | Floris

reply via email to

[Prev in Thread] Current Thread [Next in Thread]