Bad error message when number of tables exceeds limits
In a particular benchmark run with the test_min configuration, the server eventually crashes with this output:
info: account batch size = 2 txs
info: transfer batch size = 9 txs
info: Benchmark seed = 0
info(message_bus): connected to replica 0
info(message_bus): connection from client 300617403023377572042088988356056011678
thread 897938 panic: reached unreachable code
/home/azureuser/data/tigerbeetle/zig/lib/std/debug.zig:412:14: 0x11fd3dd in assert (tigerbeetle)
if (!ok) unreachable; // assertion failure
^
/home/azureuser/data/tigerbeetle/src/lsm/manifest_log.zig:1234:15: 0x1578eb0 in half_bar_compact_blocks (tigerbeetle)
assert(options.tables_count <= pace.tables_max);
^
/home/azureuser/data/tigerbeetle/src/lsm/manifest_log.zig:678:58: 0x1524b22 in compact (tigerbeetle)
manifest_log.pace.half_bar_compact_blocks(.{
^
This looks like a bug, but I think it is just the result of some tree exceeding the table_count_max limit on the number of tables.
Exceeding the maximum number of tables seems like something a user will hit in production eventually. It would be desirable for the error to say something more useful, explicitly that there are too many tables (and that this is the expected outcome).
I don't have a command to reproduce this on main but running the benchmark in the test_min config with a high account-count and low batch size will probably get there.
Would it be preferable to return an error when creating a table beyond the limit instead of crashing?
Apologies if I'm missing something.