vinyl: fix cache iterator skipping tuples in read view
The tuple cache doesn't store older tuple versions so if a reader is in a read view, it must skip tuples that are newer than the read view, see `vy_cache_iterator_stmt_is_visible()`. A reader must also ignore cached intervals if any of the tuples used as a boundary is invisible from the read view, see `vy_cache_iterator_skip_to_read_view()`. There's a bug in `vy_cache_iterator_restore()` because of which such an interval may be returned to the reader: when we step backwards from the last returned tuple we consider only one of the boundaries. As a result, if the other boundary is invisible from the read view, the reader will assume there's nothing in the index between the boundaries and skip reading older sources (memory, disk). Fix this by always checking if the other boundary is visible. Closes #10109 NO_DOC=bug fix
Showing
- changelogs/unreleased/gh-10109-vy-read-iterator-fix.md 4 additions, 0 deletionschangelogs/unreleased/gh-10109-vy-read-iterator-fix.md
- src/box/vy_cache.c 5 additions, 2 deletionssrc/box/vy_cache.c
- test/vinyl-luatest/gh_10109_read_iterator_test.lua 41 additions, 0 deletionstest/vinyl-luatest/gh_10109_read_iterator_test.lua
Please register or sign in to comment