Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: Ilya Kosarev <i.kosarev@tarantool.org>,
	Konstantin Osipov <kostja.osipov@gmail.com>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH v2] replication: fix join vclock obtainment in relay_initial_join
Date: Mon, 28 Oct 2019 22:09:45 +0100	[thread overview]
Message-ID: <9c427c1a-9c6f-263b-8cac-99458ccdc8fd@tarantool.org> (raw)
In-Reply-To: <20191028122506.4833-1-i.kosarev@tarantool.org>

Hi! Thanks for the fixes!

> diff --git a/src/box/relay.cc b/src/box/relay.cc
> index e849fcf4f..d16cd1a56 100644
> --- a/src/box/relay.cc
> +++ b/src/box/relay.cc
> @@ -306,13 +306,14 @@ relay_initial_join(int fd, uint64_t sync, struct vclock *vclock)
>  	});
>  
>  	/*
> -	 * Sync WAL to make sure that all changes visible from
> -	 * the frozen read view are successfully committed.
> +	 * Make sure that current database state is flushed to
> +	 * the WAL and obtain corresponding vclock.
>  	 */
> -	if (wal_sync() != 0)
> +	struct wal_checkpoint checkpoint;
> +	if (wal_begin_checkpoint(&checkpoint) != 0)
>  		diag_raise();
>  
> -	vclock_copy(vclock, &replicaset.vclock);
> +	vclock_copy(vclock, &checkpoint.vclock);

It looks wrong, that we do begin_checkpoint() but omit
commit_checkpoint(). I would call commit too. Probably now
begin() does not allocate any resources, but it may start
in future, and we will have a leak here.

  reply	other threads:[~2019-10-28 21:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-28 12:25 Ilya Kosarev
2019-10-28 21:09 ` Vladislav Shpilevoy [this message]
2019-10-28 21:10   ` Konstantin Osipov
2019-10-29 14:25     ` Ilya Kosarev

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=9c427c1a-9c6f-263b-8cac-99458ccdc8fd@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=i.kosarev@tarantool.org \
    --cc=kostja.osipov@gmail.com \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v2] replication: fix join vclock obtainment in relay_initial_join' \
    /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