vinyl: fix EQ check in run iterator
vy_run_iterator_seek() is supposed to check that the resulting statement matches the search key in case of ITER_EQ, but if the search key lies at the beginning of the slice, it doesn't. As a result, vy_point_lookup() may fail to find an existing tuple as demonstrated below. Suppose we are looking for key {10} in the primary index which consists of an empty mem and two runs: run 1: DELETE{15} run 2: INSERT{10} vy_run_iterator_next() returns DELETE{15} for run 1 because of the missing EQ check and vy_point_lookup() stops at run 1 (since the terminal statement is found) and mistakenly returns NULL. The issue manifests itself as crash in vinyl_iterator_secondary_next(), when we fail to find the tuple in the primary index corresponding to a statement found in a secondary index. Part of #3393
Loading
Please register or sign in to comment