Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladimir Davydov <vdavydov.dev@gmail.com>
To: Georgy Kirichenko <georgy@tarantool.org>
Cc: tarantool-patches@freelists.org
Subject: Re: [tarantool-patches] [PATCH v2 5/5] Disallow lsn gaps while vclock following
Date: Mon, 28 Jan 2019 15:18:59 +0300	[thread overview]
Message-ID: <20190128121859.h6yvexnifr6iqf5k@esperanza> (raw)
In-Reply-To: <5a4684b673896b50bcb644842510de40fe91d1cf.1548152776.git.georgy@tarantool.org>

On Tue, Jan 22, 2019 at 01:31:13PM +0300, Georgy Kirichenko wrote:
> Only one-step vclock following is allowed. This enforces wal and
> replication consistency against out of order execution.

Again, quite an obscure commit message. Please try to explain why you do
what you do so that even a sync replication noob like me can understand
it.

> 
> Prerequisite #980
> ---
>  src/box/replication.cc |  1 +
>  src/box/vclock.c       |  2 +-
>  src/box/xrow.c         |  2 +-
>  test/unit/vclock.cc    | 10 +++++-----
>  4 files changed, 8 insertions(+), 7 deletions(-)
> 
> diff --git a/src/box/replication.cc b/src/box/replication.cc
> index 51e08886c..ee92a941b 100644
> --- a/src/box/replication.cc
> +++ b/src/box/replication.cc
> @@ -91,6 +91,7 @@ replication_init(void)
>  	replicaset.replica_by_id = (struct replica **)calloc(VCLOCK_MAX, sizeof(struct replica *));
>  	latch_create(&replicaset.applier.order_latch);
>  	vclock_create(&replicaset.applier.vclock);
> +	vclock_clear(&replicaset.applier.vclock);
>  }
>  
>  void
> diff --git a/src/box/vclock.c b/src/box/vclock.c
> index c297d1ff9..807da9109 100644
> --- a/src/box/vclock.c
> +++ b/src/box/vclock.c
> @@ -56,7 +56,7 @@ vclock_follow(struct vclock *vclock, uint32_t replica_id, int64_t lsn)
>  	assert(lsn >= 0);
>  	assert(replica_id < VCLOCK_MAX);
>  	int64_t prev_lsn = vclock->lsn[replica_id];
> -	assert(lsn > prev_lsn);
> +	assert(lsn == prev_lsn + 1);

AFAIU this may break recovery from a WAL created by an older Tarantool
version that allowed LSN gaps.

>  	/* Easier add each time than check. */
>  	vclock->map |= 1 << replica_id;
>  	vclock->lsn[replica_id] = lsn;

  reply	other threads:[~2019-01-28 12:18 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-22 10:31 [tarantool-patches] [PATCH v2 0/5] Strong sequentially LSN in journal Georgy Kirichenko
2019-01-22 10:31 ` [tarantool-patches] [PATCH v2 1/5] Do not promote wal vclock for failed writes Georgy Kirichenko
2019-01-28 11:20   ` Vladimir Davydov
2019-01-29 10:22     ` Георгий Кириченко
2019-01-29 11:58       ` Vladimir Davydov
2019-01-22 10:31 ` [tarantool-patches] [PATCH v2 2/5] Update replicaset vclock from wal Georgy Kirichenko
2019-01-28 11:59   ` Vladimir Davydov
2019-01-29 10:33     ` [tarantool-patches] " Георгий Кириченко
2019-01-22 10:31 ` [tarantool-patches] [PATCH v2 3/5] Enforce applier out of order protection Georgy Kirichenko
2019-01-28 12:09   ` Vladimir Davydov
2019-01-29 10:30     ` [tarantool-patches] " Георгий Кириченко
2019-01-29 12:00       ` Vladimir Davydov
2019-01-22 10:31 ` [tarantool-patches] [PATCH v2 4/5] Emit NOP if an applier skips row Georgy Kirichenko
2019-01-28 12:15   ` Vladimir Davydov
2019-02-08 16:50   ` [tarantool-patches] " Konstantin Osipov
2019-01-22 10:31 ` [tarantool-patches] [PATCH v2 5/5] Disallow lsn gaps while vclock following Georgy Kirichenko
2019-01-28 12:18   ` Vladimir Davydov [this message]
2019-01-28 11:15 ` [tarantool-patches] [PATCH v2 0/5] Strong sequentially LSN in journal Vladimir Davydov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190128121859.h6yvexnifr6iqf5k@esperanza \
    --to=vdavydov.dev@gmail.com \
    --cc=georgy@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='Re: [tarantool-patches] [PATCH v2 5/5] Disallow lsn gaps while vclock following' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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