Zach Brown e034ffa7e9 scoutfs: fix forest iteration
The forest item iterator was missing items.  Picture the following
search pattern:

 - find a candidate item to return in a root
 - ignore a greater candidate to return in another root
 - find the first candidates item's deletion in another root

The problem was that finding the deletion item didn't reset the notion
that we'd found a key.  The next item from the second root was never
used because the found key wasn't reset and that root had already
searched past the found key.

The core architectural problem is that iteration can't examine each item
only once given that keys and deletions can be randomly distributed
across the roots.

The most efficient way to solve the problem is to really sort the
iteration positions in each root and then walk those in order.  We
get the right answer and pay some data structure overhead to perform
the minimum number of btree searches.

Signed-off-by: Zach Brown <zab@versity.com>
2020-01-17 11:21:36 -08:00
2020-01-17 11:21:36 -08:00
Description
No description provided
6.2 MiB
Languages
C 86.4%
Shell 10%
Roff 2.5%
TeX 0.8%
Makefile 0.3%