Tarantool development patches archive
 help / color / mirror / Atom feed
* [PATCH v2 0/5] Prepare vylog for space alter
@ 2018-03-20 11:29 Vladimir Davydov
  2018-03-20 11:29 ` [PATCH v2 1/5] vinyl: refactor vylog recovery Vladimir Davydov
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Vladimir Davydov @ 2018-03-20 11:29 UTC (permalink / raw)
  To: kostja; +Cc: tarantool-patches

The vinyl metadata log (vylog) has two idiosyncrasies that thwart
implementation of ALTER of vinyl spaces. The first one is the
callback-based recovery procedure (see vy_recovery_iterate): an
attempt to purge incomplete indexes from vylog after restart using the
recovery callback would result in extremely ugly and obfuscated code.
The second problem is the way indexes are identified in vylog: we
currently use LSN as a unique identifier, but it won't be unique if
more than one index is altered in one operation, which is the case
when the primary key definition is changed.

The patch set solves both these problems as follows:
 - Patch 1 refactors the recovery procedure so that it uses plain
   iterators instead of callbacks.
 - Patch 2 and 3 do some renames in preparation for patch 4.
 - Patch 4 ceases usage of LSN as unique index identifier. Instead
   it introduces a special unique index id, similar to range id or
   slice id we already have.
 - Patch 5 does some cleanup in ALTER code that becomes possible
   after patch 4 is applied.

https://github.com/tarantool/tarantool/tree/vy-prepare-vylog-for-alter

Changes in v2:
 - Introduce unique index id for identifying indexes in vylog
   instead of using space_id/index_id pair in v1. We still need
   a unique id, because during index rebuild (yet to be implemented),
   two indexes with the same space_id/index_id will coexist.
 - Do not use 'incarnation' counter for distinguishing different
   incarnations of the same index. Use LSN as before.

v1: https://www.freelists.org/post/tarantool-patches/PATCH-04-Prepare-vylog-for-space-alter

Vladimir Davydov (5):
  vinyl: refactor vylog recovery
  vinyl: rename vy_index::id to index_id
  vinyl: rename vy_log_record::index_id/space_id to
    index_def_id/space_def_id
  vinyl: do not use index lsn to identify indexes in vylog
  alter: rewrite space truncation using alter infrastructure

 src/box/alter.cc            | 107 +-------
 src/box/memtx_space.c       |  29 +-
 src/box/space.h             |  44 ----
 src/box/sysview_engine.c    |  17 --
 src/box/vinyl.c             | 611 +++++++++++++++---------------------------
 src/box/vy_index.c          | 416 +++++++++++++++--------------
 src/box/vy_index.h          |  36 +--
 src/box/vy_log.c            | 626 +++++++++++++++-----------------------------
 src/box/vy_log.h            | 282 ++++++++++++--------
 src/box/vy_point_lookup.c   |   2 +-
 src/box/vy_read_iterator.c  |   5 +-
 src/box/vy_scheduler.c      |  29 +-
 src/box/vy_tx.c             |   4 +-
 test/unit/vy_log_stub.c     |   8 +-
 test/unit/vy_point_lookup.c |   6 +-
 test/vinyl/layout.result    |  64 ++---
 16 files changed, 894 insertions(+), 1392 deletions(-)

-- 
2.11.0

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-03-22 15:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-20 11:29 [PATCH v2 0/5] Prepare vylog for space alter Vladimir Davydov
2018-03-20 11:29 ` [PATCH v2 1/5] vinyl: refactor vylog recovery Vladimir Davydov
2018-03-20 11:29 ` [PATCH v2 2/5] vinyl: rename vy_index::id to index_id Vladimir Davydov
2018-03-20 11:29 ` [PATCH v2 3/5] vinyl: rename vy_log_record::index_id/space_id to index_def_id/space_def_id Vladimir Davydov
2018-03-20 11:29 ` [PATCH v2 4/5] vinyl: do not use index lsn to identify indexes in vylog Vladimir Davydov
2018-03-22 15:08   ` Vladimir Davydov
2018-03-20 11:29 ` [PATCH v2 5/5] alter: rewrite space truncation using alter infrastructure Vladimir Davydov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox