Diagnostics and Troubleshooting
This document gives brief references to diagnostics and troubleshooting interfaces available in the library.
A small collection of print routines is available which can be used to examine key data strucures, such as the SplinterDB trunk pages, BTree pages, space-allocation maps and so on.
trunk_print_super_block Print contents of SplinterDB super block
trunk_print Print contents of a Trunk node (page)
trunk_print_subtree Print contents of all sub-trees under a Trunk node (page)
trunk_print_space_use Print space usage by level across all trunk nodes
trunk_print_memtable Print contents of all Memtables in Splinter. Drills-down to printing BTrees under Memtables
rc_allocator_print_allocated Print the space allocation maps and lists of extents / pages allocated.
rc_allocator_print_stats Prints basic statistics about the allocator state.
A small unit test to exercise these print diagnostics can be found here, splinter_test.c:test_splinter_print_diags.
A useful way to learn about SplinterDB internal structures is to run this test case:
$ bin/unit/splinter_test test_splinter_print_diags
This test case creates a small SplinterDB instance, and loads a large set of rows, enough to create several pages in the trunk.
Examine the outputs generated in /tmp/unit_test.stdout by this test case to get a quick view of the internal structures.