Tarantool development patches archive
 help / color / mirror / Atom feed
From: Cyrill Gorcunov via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Serge Petrenko <sergepetrenko@tarantool.org>
Cc: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>,
	tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH 1/1] applier: process synchro rows after WAL write
Date: Thu, 8 Apr 2021 13:19:15 +0300	[thread overview]
Message-ID: <YG7Yo9tu/YlT4S1r@grain> (raw)
In-Reply-To: <71ee3907-a8fd-d916-fc6a-3205e66f2d29@tarantool.org>

On Thu, Apr 08, 2021 at 11:39:03AM +0300, Serge Petrenko wrote:
> 
> Thanks for the patch!
> 
> I'm a bit worried about two different synchro rows coming from two
> appliers. Is everything ok in this case?

Serge, you mean the scenario when some instances in replicaset
have the patch applied and some are not?

> Or even normal rows coming from other appliers. Say some other replica
> has already applied this synchro row and even has written some rows on
> top of it. Its applier won't block on replica_id latch, and may fail to
> apply
> some txs following this synchro row, because it's not yet written to WAL
> and thus not applied (limbo is still not empty or belongs to other
> instance).
> 
> Looks like this won't be a problem once synchro rows start pinning the
> limbo to some specific replica. Because in this case only the replica that
> has issued confirm will be able to generate new rows. And these rows will
> be ordered by replica_id latch.
> 
> But still, maybe this is worth fixing?
> Am I missing something?

> > -	struct journal_entry journal_entry;
> > +	union {
> > +		struct journal_entry base;
> > +		char base_buf[sizeof(base) + sizeof(base.rows[0])];
> > +	};
> >   };
> 
> I don't understand this union stuff.
> The journal_entry is the last entry in synchro_entry anyway.
> Is this a hack for allowing to allocate synchro_entry on the stack?

Yeah, the journal_entry last member is zero size array so someone
has to preallocate memory for rows and using union allows to squash
everything statically on stack.

  reply	other threads:[~2021-04-08 10:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-07 22:47 Vladislav Shpilevoy via Tarantool-patches
2021-04-08  8:39 ` Serge Petrenko via Tarantool-patches
2021-04-08 10:19   ` Cyrill Gorcunov via Tarantool-patches [this message]
2021-04-08 10:32     ` Serge Petrenko via Tarantool-patches
2021-04-08 10:46       ` Cyrill Gorcunov via Tarantool-patches
2021-04-08 22:57       ` Vladislav Shpilevoy via Tarantool-patches
2021-04-09  8:25         ` Serge Petrenko via Tarantool-patches
2021-04-09 21:32           ` Vladislav Shpilevoy via Tarantool-patches
2021-04-08 22:56   ` Vladislav Shpilevoy via Tarantool-patches
2021-04-09  8:26     ` Serge Petrenko via Tarantool-patches

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=YG7Yo9tu/YlT4S1r@grain \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=gorcunov@gmail.com \
    --cc=sergepetrenko@tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 1/1] applier: process synchro rows after WAL write' \
    /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