Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladimir Davydov <vdavydov.dev@gmail.com>
To: "Георгий Кириченко" <georgy@tarantool.org>
Cc: tarantool-patches@freelists.org
Subject: Re: [tarantool-patches] Re: [PATCH v2 3/5] Enforce applier out of order protection
Date: Tue, 29 Jan 2019 15:00:43 +0300	[thread overview]
Message-ID: <20190129120042.vwboca44w4ffxryj@esperanza> (raw)
In-Reply-To: <774394922.0SCKpy4CPs@home.lan>

On Tue, Jan 29, 2019 at 01:30:40PM +0300, Георгий Кириченко wrote:
> On Monday, January 28, 2019 3:09:01 PM MSK Vladimir Davydov wrote:
> > On Tue, Jan 22, 2019 at 01:31:11PM +0300, Georgy Kirichenko wrote:
> > > Do not skip row until the row is not processed by other appliers.
> > 
> > Looks like a fix for
> > 
> >   https://github.com/tarantool/tarantool/issues/3568
> > 
> > Worth adding a test?
> > 
> > > Prerequisite #980
> > > ---
> > > 
> > >  src/box/applier.cc | 35 ++++++++++++++++++-----------------
> > >  1 file changed, 18 insertions(+), 17 deletions(-)
> > > 
> > > diff --git a/src/box/applier.cc b/src/box/applier.cc
> > > index 87873e970..148c8ce5a 100644
> > > --- a/src/box/applier.cc
> > > +++ b/src/box/applier.cc
> > > @@ -504,6 +504,22 @@ applier_subscribe(struct applier *applier)
> > > 
> > >  		applier->lag = ev_now(loop()) - row.tm;
> > >  		applier->last_row_time = ev_monotonic_now(loop());
> > > 
> > > +		struct replica *replica = replica_by_id(row.replica_id);
> > > +		struct latch *latch = (replica ? &replica->order_latch :
> > > +				       &replicaset.applier.order_latch);
> > > +		/*
> > > +		 * In a full mesh topology, the same set
> > > +		 * of changes may arrive via two
> > > +		 * concurrently running appliers. Thanks
> > > +		 * to vclock_follow() above, the first row
> > 
> > I don't see any vclock_follow() above. Please fix the comment.
> > 
> > > +		 * in the set will be skipped - but the
> > > +		 * remaining may execute out of order,
> > > +		 * when the following xstream_write()
> > > +		 * yields on WAL. Hence we need a latch to
> > > +		 * strictly order all changes which belong
> > > +		 * to the same server id.
> > > +		 */
> > > +		latch_lock(latch);
> > > 
> > >  		if (vclock_get(&replicaset.applier.vclock,
> > >  		
> > >  			       row.replica_id) < row.lsn) {
> > >  			
> > >  			if (row.replica_id == instance_id &&
> > 
> > AFAIU this patch makes replicaset.applier.vclock, introduced by the
> > previous patch, useless.
> You are right now, but I plan to release this latch just before commit in case 
> of parallel applier.

Then let's please introduce applier.vclock when we get to implement
parallel applier, because currently I can't say for sure whether we
really need it or not.

  reply	other threads:[~2019-01-29 12:00 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 [this message]
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
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=20190129120042.vwboca44w4ffxryj@esperanza \
    --to=vdavydov.dev@gmail.com \
    --cc=georgy@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='Re: [tarantool-patches] Re: [PATCH v2 3/5] Enforce applier out of order protection' \
    /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