[PATCH v2 0/3] vinyl: alternative fix for tx read set bloating

Vladimir Davydov vdavydov.dev at gmail.com
Wed Mar 7 15:06:30 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

Changes in v2:
 - Require the caller of vy_point_lookup() to make sure the key is
   tracked with vy_tx_track() instead of using a flag parameter.
 - Rebase on the latest 1.9

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                  | 161 ++++++++++++++++++---------------------
 src/box/vy_point_lookup.c        |  12 ---
 src/box/vy_point_lookup.h        |   9 +++
 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/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 +++++----
 17 files changed, 276 insertions(+), 312 deletions(-)

-- 
2.11.0




More information about the Tarantool-patches mailing list