Problem is that we sometimes get errors resulting
from files being written as a result of pending
merges. Closing a tree should stop all such
file-level activity.
First implementation of range fold
Range folding doesn't prohibit insert/lookup or
merge operations, but each level can only have
one range fold operation active.
Thus, worst case active range folds can double
space requirements, because it holds hard-linked
copies of used btree files.
- Code moved to separate module
- Recovery now operational; re-opening a
tree will actually read the nursery log.
We use a sequential log file for the nursery
and also keep inserted {K,V} in memory
only 32 K/V pairs at a time.
NURSERY_SIZE = (1 bsl TOP_LEVEL)
configured in src/lsm_btree.htl
A dict is open and with keys if its size is greater than 0. Go through
the dicts one by one with lists:any/2 and use that to optimize the
check. Ought to run faster than traversing the full set.
To make failing keys work we must be able to produce a key in fewer
failures then currently. So encode the picker for non-empty trees
directly so it is much faster and doesn't try to do it by generating a
case and then asking "is this one good enough?". A simple
dict:filter/2 does it.
This patch implements another possible command: Lookup of keys that
already exist in the tree somewhere. We use a dict as the test tool:
the postcondition verifies that the value obtained from the fractal
btree matches the one we put in the dict earlier.
If we decide to stop the driver, we should not reply back before we
have a clean state with all BTrees closed.
Also, implement lookup of existing keys in the tree.
; Split the writer tests to the writer parts. This is not entirely
correct since they both read and write, but oh, well.
; Provide a simple statem test which opens trees and puts values.
This allows us to use file:pread to read a
child-node, rather than two separate reads
(one for node block size, and then one for
the node block itself).
Also, encode the level# in node header, so that
scanning leafs doesn't need to decode the
node contents for inner nodes.