[PATCH 2/3] wal: rollback vclock on write failure
Konstantin Osipov
kostja at tarantool.org
Wed Jun 27 20:22:16 MSK 2018
* Vladimir Davydov <vdavydov.dev at gmail.com> [18/06/15 23:28]:
> In order to determine whether we need to rebootstrap the instance on
> startup, we need to know its vclock. To find it out, we scan the last
> xlog file before proceeding to local recovery, but this means in case
> rebootstrap is not required we scan the last xlog twice, which is
> sub-optimal. To avoid double scan, we can create a new empty xlog before
> shutting down the server and reopen it after restart. However, since we
> promote WAL writer vclock even if xlog write fails, there will be an LSN
> gap between the last xlog and the one created on shutdown in case we
> failed to write last few records. To avoid that, let's rollback WAL
> writer vclock if write fails. BTW this will make it consistent with
> replicaset vclock - see commit 3c4bac715960a ("Follow vclock only for
> success wal writes").
Please add previous xlog's vclock to the next xlog header and use
it to watch gaps/missing xlogs in recover_remaining_wals().
If the necessary header is missing, simply ignore the gaps.
Ignore LSN gaps, they are harmless, and using LSN gaps as a mark
of xlog dir corruption was a bad idea from the start.
Logical markers should not be used to verify consistency of the
physical layer.
--
Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
http://tarantool.io - www.twitter.com/kostja_osipov
More information about the Tarantool-patches
mailing list