vinyl: don't advance read iterator pos after restore to min key
If the iterator over a merge source was restored to a newer version of the min key, we must not increment front_id, otherwise the source won't be advanced on the next iteration, potentially resulting in the same key returned twice by vy_merge_iterator_next_key(). In the long run, this is likely to break the cache. Fix this and add an assert() checking that it never happens. While we are at it, remove loop from vy_read_iterator_merge_next_key() that checks that the statement returned by vy_merge_iterator_next_key() isn't the same as the statement returned to the user last time. The loop condition should never evaluate to true, which is assured by the new assert(). Fixes: 61ffe793 ("vinyl: fix read iterator restoration to a newer version of the same key").
Loading
Please register or sign in to comment