tmf: Fix wrong interval returns in the history backend
Since intervals are sorted (by end time) in their nodes,
the algorithm to pick the correct interval during a query
would first find the "starting point", where the intervals
can begin intersecting the target time.
Then, it would iterate over the remainder of the list, but only
comparing the *start* times, since we know that at this point,
the end times should all fit in.
Turns out this is not the case! It's possible for a node's end
time to be greater than its last intervals' end times. So if a
query was done in this "empty space", the node could wrongly
return an interval whose start time fits, but not its end time!
If every other condition is respected, now we additionally check
the end time too. This avoids a potential infinite loop during
range queries.
Also updated the tests accordingly.
Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
This page took 0.025689 seconds and 5 git commands to generate.