Done ! It was quite painful, with many small bugs that took a while to fix, due to the lack of tooling atm (enough said I had to do many hexdump -C mavibot.db to analyze the content of the file...)
Here is an exemple of a reformated mavibot.db file after the creation of a 'test' B-tree and the injection of three elements into it : <3,V3>, <1,V1> and <5,V5> (test testRecordManagerBrowseWithKeepRevisions) : 0000 RMHeader, FirstFreePage = 1A00, CurrentBOB = 1400, CurrentCP = 2000 0200 test:1 H -> 0400 0400 test:1 RP 0600 test:2 H -> 0800 0800 test:1 RP 0A00 test:0 H -> 0C00 0C00 test:0 RP 0E00 FP[2] -> 1000 1000 FP[3] -| 1200 BOB:4 rp (0A00, 0200, 0600, 1800) 1400 BOB:4 H -> 1200 1600 test:3 RP 1800 test:3 H -> 1600 1A00 FP[0] -> 1C00 1C00 FP[1] -> 0E00 1E00 CP:3 RP 2000 CP:3 H -> 1E00 All the useful pages are there, the freePages list is correct, the management BTrees (BOB and CP) are also correct. Here are the content of each page : 00000000 00 00 02 00 00 00 00 01 00 00 00 00 00 00 1a 00 |................| 00000010 00 00 00 00 00 00 14 00 ff ff ff ff ff ff ff ff |................| 00000020 00 00 00 00 00 00 20 00 ff ff ff ff ff ff ff ff |...... .........| 00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| test:1 H -> 0400 00000200 ff ff ff ff ff ff ff ff 00 00 00 aa 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 04 00 test:1 RP * 00000400 ff ff ff ff ff ff ff ff 00 00 00 2e 00 00 00 00 |................| 00000410 00 00 00 01 00 00 00 01 00 00 00 1e 00 00 00 01 |................| 00000420 00 00 00 0a 00 00 00 06 00 00 00 02 56 33 00 00 |............V3..| 00000430 00 08 00 00 00 00 00 00 00 03 00 00 00 00 00 00 |................| 00000440 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| test:2 H -> 0800 00000600 ff ff ff ff ff ff ff ff 00 00 00 aa 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 02 00 00 00 00 00 00 08 00 test:2 RP 00000800 ff ff ff ff ff ff ff ff 00 00 00 4c 00 00 00 00 |...........L....| 00000810 00 00 00 02 00 00 00 02 00 00 00 3c 00 00 00 01 |...........<....| 00000820 00 00 00 0a 00 00 00 06 00 00 00 02 56 31 00 00 |............V1..| 00000830 00 08 00 00 00 00 00 00 00 01 00 00 00 01 00 00 |................| 00000840 00 0a 00 00 00 06 00 00 00 02 56 33 00 00 00 08 |..........V3....| 00000850 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 00 |................| 00000860 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| test:0 H -> 00000a00 ff ff ff ff ff ff ff ff 00 00 00 aa 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0c 00 test:0 RP test:0 RP 00000c00 ff ff ff ff ff ff ff ff 00 00 00 0c 00 00 00 00 |................| 00000c10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| FP[2] -> 1000 00000e00 00 00 00 00 00 00 10 00 00 00 00 88 00 00 00 00 |................| FP[3] -| 00001000 ff ff ff ff ff ff ff ff 00 00 00 b2 00 00 00 00 |................| BOB rp r4 00001200 ff ff ff ff ff ff ff ff 00 00 00 b0 00 00 00 00 00 00 00 04 00 00 00 04 00 00 00 a0 00 00 00 01 00 00 00 0c 00 00 00 08 00 00 00 00 00 00 0a 00 test:0 H 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 04 74 65 73 74 00 00 00 01 00 00 00 0c 00 00 00 08 00 00 00 00 00 00 02 00 test:1 H 00 00 00 10 00 00 00 00 00 00 00 01 00 00 00 04 74 65 73 74 00 00 00 01 00 00 00 0c 00 00 00 08 00 00 00 00 00 00 06 00 test:2 H 00 00 00 10 00 00 00 00 00 00 00 02 00 00 00 04 74 65 73 74 00 00 00 01 00 00 00 0c 00 00 00 08 00 00 00 00 00 00 18 00 test:3 H 00 00 00 10 00 00 00 00 00 00 00 03 00 00 00 04 74 65 73 74 BOB H r4 00001400 ff ff ff ff ff ff ff ff 00 00 00 b2 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 04 00 00 00 00 00 00 12 00 BOB rp r4 test:3 RP 00001600 ff ff ff ff ff ff ff ff 00 00 00 6a 00 00 00 00 |...........j....| test:3 H -> 00001800 ff ff ff ff ff ff ff ff 00 00 00 aa 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 00 00 00 00 00 00 16 00 -> test:3 RP FP[0] -> 1C00 00001a00 00 00 00 00 00 00 1c 00 00 00 00 68 00 00 00 00 |...........h....| FP[1] -> 0E00 00001c00 00 00 00 00 00 00 0e 00 00 00 00 b7 00 00 00 00 |................| CP:3 RP 00001e00 ff ff ff ff ff ff ff ff 00 00 00 94 00 00 00 00 00 00 00 03 00 00 00 03 00 00 00 84 00 00 00 01 00 00 00 10 00 00 00 0c 00 00 00 01 00 00 00 00 00 00 0c 00 CopiedPage test:1/0C00 test:0 RP 00 00 00 10 00 00 00 00 00 00 00 01 00 00 00 04 74 65 73 74 00 00 00 01 00 00 00 10 00 00 00 0c 00 00 00 01 00 00 00 00 00 00 04 00 CopiedPage test:2/0400 test:1 RP 00 00 00 10 00 00 00 00 00 00 00 02 00 00 00 04 74 65 73 74 00 00 00 01 00 00 00 10 00 00 00 0c 00 00 00 01 00 00 00 00 00 00 08 00 CopiedPage test:3/0800 test:2 RP 00 00 00 10 00 00 00 00 00 00 00 03 00 00 00 04 74 65 73 74 CP:3 H -> 1E00 00002000 ff ff ff ff ff ff ff ff 00 00 00 b7 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 00 00 00 00 00 00 1e 00 00 00 00 10 00 00 00 11 5f 63 6f 70 Next step : fixing the failing tests... -- Regards, Cordialement, Emmanuel Lécharny www.iktek.com