Tarantool development patches archive
 help / color / mirror / Atom feed
* [PATCH v2 0/6] Create empty xlog on shutdown
@ 2018-06-29 16:48 Vladimir Davydov
  2018-06-29 16:48 ` [PATCH v2 1/6] xlog: store prev vclock in xlog header Vladimir Davydov
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Vladimir Davydov @ 2018-06-29 16:48 UTC (permalink / raw)
  To: kostja; +Cc: tarantool-patches

In order to determine if the instance needs to be rebootstrapped,
we need to know its vclock and we need to know it before we start
recovery (see #461). We are planning to retrieve the vclock by
rescanning the last xlog. In order not to degrade recovery time
in case rebootstrap is not needed, let's create a new empty xlog
on shutdown.

Patches 1-4 of the series improve the LSN gap check so that it
doesn't trigger in case an xlog has a gap at the end due to write
errors. They are needed to make the tests pass after patch 5 is
applied.

Patch 5 makes WAL thread create an empty xlog on shutdown and
reopen it on restart.

Patch 6 is optional: it moves XlogGapError to box/error.h, where
other exceptions are defined.

https://github.com/tarantool/tarantool/issues/461
https://github.com/tarantool/tarantool/commits/wal-make-new-xlog-on-shutdown

Changes in v2:
 - Drop the patch that makes WAL rollback LSN on write failure.
   Instead add PrevVclock to xlog header to improve gap check,
   as suggested by Kostja.
 - Improve comments and refactor the code as per review.

v1: https://www.freelists.org/post/tarantool-patches/PATCH-03-Speed-up-recovery-in-case-rebootstrap-is-not-needed

Vladimir Davydov (6):
  xlog: store prev vclock in xlog header
  xlog: differentiate between closed and never opened cursor
  recovery: make LSN gap check more thorough
  recovery: promote recovery clock even if the WAL is empty
  wal: create empty xlog on shutdown
  error: move XlogGapError to box/error.h

 src/box/CMakeLists.txt                |   2 +-
 src/box/error.cc                      |  36 ++++++++--
 src/box/error.h                       |  16 +++++
 src/box/recovery.cc                   | 118 +++++++++++++++-----------------
 src/box/wal.c                         |  94 ++++++++++++++++++++++++-
 src/box/xlog.c                        |  70 ++++++++++++++-----
 src/box/xlog.h                        |  17 ++++-
 src/diag.h                            |   2 -
 test/replication/gc.result            |  23 +------
 test/replication/gc.test.lua          |   8 +--
 test/replication/hot_standby.result   |  12 ++--
 test/replication/hot_standby.test.lua |   4 +-
 test/xlog-py/dup_key.result           |  20 ++----
 test/xlog-py/dup_key.test.py          |  29 +++-----
 test/xlog/errinj.result               |   1 +
 test/xlog/header.result               |  41 +++++++++++
 test/xlog/header.test.lua             |  13 ++++
 test/xlog/panic_on_lsn_gap.result     | 125 ++++++++++++++++++++++++++++------
 test/xlog/panic_on_lsn_gap.test.lua   |  33 +++++++--
 test/xlog/panic_on_wal_error.result   |  23 +------
 test/xlog/panic_on_wal_error.test.lua |   9 +--
 21 files changed, 480 insertions(+), 216 deletions(-)

-- 
2.11.0

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

end of thread, other threads:[~2018-07-10 16:28 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-29 16:48 [PATCH v2 0/6] Create empty xlog on shutdown Vladimir Davydov
2018-06-29 16:48 ` [PATCH v2 1/6] xlog: store prev vclock in xlog header Vladimir Davydov
2018-07-05  6:49   ` Konstantin Osipov
2018-07-05  6:52   ` Konstantin Osipov
2018-07-05  8:23     ` Vladimir Davydov
2018-07-05 11:22       ` Konstantin Osipov
2018-07-10 16:28         ` [PATCH] xlog: get rid of xlog_meta::has_prev_vclock Vladimir Davydov
2018-06-29 16:48 ` [PATCH v2 2/6] xlog: differentiate between closed and never opened cursor Vladimir Davydov
2018-06-29 16:48 ` [PATCH v2 3/6] recovery: make LSN gap check more thorough Vladimir Davydov
2018-06-29 16:48 ` [PATCH v2 4/6] recovery: promote recovery clock even if the WAL is empty Vladimir Davydov
2018-06-29 16:48 ` [PATCH v2 5/6] wal: create empty xlog on shutdown Vladimir Davydov
2018-06-29 16:48 ` [PATCH v2 6/6] error: move XlogGapError to box/error.h Vladimir Davydov

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