Tarantool development patches archive
 help / color / mirror / Atom feed
* [PATCH 0/4] Prepare vylog for space alter
@ 2018-03-17 17:56 Vladimir Davydov
  2018-03-17 17:56 ` [PATCH 1/4] vinyl: refactor vylog recovery Vladimir Davydov
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Vladimir Davydov @ 2018-03-17 17:56 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 replaces LSN with space and index id as index identifier
   in vylog.
 - Patches 3 and 4 do some cleanup that becomes possible after
   patch 2 is applied.

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

Vladimir Davydov (4):
  vinyl: refactor vylog recovery
  vinyl: do not use index lsn to identify indexes in vylog
  index: remove lsn from commit_create arguments
  alter: rewrite space truncation using alter infrastructure

 src/box/alter.cc         | 135 ++--------
 src/box/index.cc         |   2 +-
 src/box/index.h          |  12 +-
 src/box/memtx_space.c    |  29 +--
 src/box/space.h          |  44 ----
 src/box/sysview_engine.c |  17 --
 src/box/vinyl.c          | 593 ++++++++++++++----------------------------
 src/box/vy_index.c       | 404 ++++++++++++++---------------
 src/box/vy_index.h       |  34 +--
 src/box/vy_log.c         | 651 +++++++++++++++++++----------------------------
 src/box/vy_log.h         | 297 +++++++++++++--------
 src/box/vy_scheduler.c   |  12 +-
 test/unit/vy_log_stub.c  |   8 +-
 test/vinyl/layout.result |  36 +--
 14 files changed, 902 insertions(+), 1372 deletions(-)

-- 
2.11.0

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

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

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-17 17:56 [PATCH 0/4] Prepare vylog for space alter Vladimir Davydov
2018-03-17 17:56 ` [PATCH 1/4] vinyl: refactor vylog recovery Vladimir Davydov
2018-03-17 17:56 ` [PATCH 2/4] vinyl: do not use index lsn to identify indexes in vylog Vladimir Davydov
2018-03-19 15:01   ` Vladimir Davydov
2018-03-17 17:56 ` [PATCH 3/4] index: remove lsn from commit_create arguments Vladimir Davydov
2018-03-17 17:56 ` [PATCH 4/4] 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