[PATCH 0/3] vinyl: alternative fix for tx read set bloating
Vladimir Davydov
vdavydov.dev at gmail.com
Wed Mar 7 12:05:08 MSK 2018
When we iterate over a secondary index, we track not only the interval
read from the secondary index, but also each tuple retrieved from the
primary index, which results in read set bloating (see #2534).
Originally, the problem was fixed by forcing all autocommit SELECTs to
open a read view immediately, but that entailed a problem with the
tuple cache - now a SELECT called outside transaction doesn't populate
the cache at all, which affects performance (#3197).
In fact, we don't need to track tuples in primary index when we are
scanning a secondary index, because whenever we change a tuple in the
primary index, we update it in all secondary indexes, so tracking in a
secondary index is enough. So this patch reverts the original fix
(patch 1) and instead removes this extra tracking (patches 2 and 3).
https://github.com/tarantool/tarantool/issues/2534
https://github.com/tarantool/tarantool/issues/3197
https://github.com/tarantool/tarantool/tree/gh-2534-vy-dont-open-rv-for-select
Vladimir Davydov (3):
Revert "vinyl: force read view in iterator in autocommit mode"
vinyl: use point lookup explicitly where appropriate
vinyl: don't track tuples that are already tracked in secondary index
src/box/vinyl.c | 143 ++++++++++++++++-----------------------
src/box/vy_point_lookup.c | 6 +-
src/box/vy_point_lookup.h | 10 ++-
src/box/vy_read_iterator.c | 18 -----
src/box/vy_tx.c | 12 ++--
src/box/vy_tx.h | 17 +++--
test/engine/iterator.result | 16 ++---
test/engine/iterator.test.lua | 8 ---
test/unit/vy_point_lookup.c | 2 +-
test/vinyl/cache.result | 22 +++---
test/vinyl/cache.test.lua | 12 ++--
test/vinyl/errinj.result | 19 +++---
test/vinyl/errinj.test.lua | 11 +--
test/vinyl/iterator.result | 110 ++++++++++++++++++------------
test/vinyl/partial_dump.result | 17 +----
test/vinyl/partial_dump.test.lua | 13 +---
test/vinyl/tx_gap_lock.result | 97 ++++++++++++++------------
test/vinyl/tx_gap_lock.test.lua | 34 ++++++----
18 files changed, 262 insertions(+), 305 deletions(-)
--
2.11.0
More information about the Tarantool-patches
mailing list