Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: Sergey Petrenko <sergepetrenko@tarantool.org>, georgy@tarantool.org
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH 5/5] replication: introduce anonymous replica.
Date: Wed, 25 Dec 2019 19:23:06 +0100	[thread overview]
Message-ID: <b42173d3-a47e-1ebe-8fc0-92b12d7f3910@tarantool.org> (raw)
In-Reply-To: <1577277613.853244140@f556.i.mail.ru>

Hi! Thanks for the fixes!

>> See 16 comments/questions below.
>>
>> On 15/12/2019 21:58, sergepetrenko wrote:
>>> This commit introduces anonymous replicas. Such replicas do not pollute
>>> _cluster table (they can only be read-only and have a zero id in return).
>>> An anonymous replica can be promoted to a normal one if needed.
>>
>> 1. Do we need the promotion? Seems like it was not asked for, but we will
>> need to support it forever in case we allow this now. Also it looks not
>> even, when I can promote, but can't demote.
> 
> Well, one of the use cases for anonymous replica, in my opinion, is a backup
> instance, which can be promoted once one of the normal instances gets down.
> (Almost like a hot standby instance).

Fair, then lets keep it.

> Regarding demotion, what if I add it later after giving it some thought?

Sounds good.

>>> +relay_final_join(io->fd, header->sync, &start_vclock, &stop_vclock);
>>> +say_info("final data sent.");
>>> +
>>> +struct xrow_header row;
>>> +/* Send end of WAL stream marker */
>>> +xrow_encode_vclock_xc(&row, &replicaset.vclock);
>>> +row.sync = header->sync;
>>> +coio_write_xrow(io, &row);
>>> +
>>> +/*
>>> + * Advance the WAL consumer state to the position where
>>> + * FINAL JOIN ended and assign it to the replica.
>>> + */
>>> +gc_consumer_advance(gc, &stop_vclock);
>>> +replica = replica_by_uuid(&instance_uuid);
>>> +if (replica->gc != NULL)
>>> +gc_consumer_unregister(replica->gc);
>>
>> 9. How is that possible that the former anon replica has gc?
> 
> Anon replica receives a gc registration in replica_set_id, which is called
> above.

I missed that, thanks. Then it looks ok.

>>>  /** Vinyl run info stored in .index file */
>>>  VY_INDEX_RUN_INFO = 100,
>>> diff --git a/src/box/relay.cc b/src/box/relay.cc
>>> index e849fcf4f..14644716d 100644
>>> --- a/src/box/relay.cc
>>> +++ b/src/box/relay.cc
>>> @@ -569,11 +569,17 @@ relay_subscribe_f(va_list ap)
>>>  cbus_pair("tx", relay->endpoint.name, &relay->tx_pipe,
>>>    &relay->relay_pipe, NULL, NULL, cbus_process);
>>>
>>> -/* Setup garbage collection trigger. */
>>> +/*
>>> + * Setup garbage collection trigger.
>>> + * Not needed for anonymous replicas, since they
>>> + * aren't registered with gc at all.
>>> + */
>>
>> 14. If a master does not register an anon replica as a gc consumer,
>> it will remove xlogs even if the replica didn't get them yet. Not
>> sure, if we want that behaviour. AFAIU, purpose of anon replicas
>> is to break the limit on vlock size about 32 instances only.
> 
> True, but if we do register replicas as gc consumers there is no way
> to exclude them, so such a replica, in case of failure, will stall gc on master
> forever. We need some mechanism, to remove anonymous replicas from gc
> consumers. Normal replicas can be removed by deleting their entries from
> _cluster, we cannot do this for anonymous replicas. And if we just remove
> replica from gc consumer on every disconnect, there is no point in registering
> it with gc at all, since the point of gc consumer, among others, is to wait for
> dead replicas to reconnect and collect xlogs.

How anon replicas are removed now? I mean when are they dropped automatically
from the master? Is it done on each disconnect?

  reply	other threads:[~2019-12-25 18:23 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-15 20:56 [Tarantool-patches] [PATCH 0/5] introduce anonymous replicas sergepetrenko
2019-12-15 20:58 ` [Tarantool-patches] [PATCH 1/5] box: update comment describing join protocol sergepetrenko
2019-12-22 17:58   ` Vladislav Shpilevoy
2019-12-23 21:12     ` Sergey Petrenko
2019-12-15 20:58 ` [Tarantool-patches] [PATCH 2/5] replication: do not decode replicaset uuid when processing a subscribe sergepetrenko
2019-12-15 20:58 ` [Tarantool-patches] [PATCH 3/5] applier: split join processing into two stages sergepetrenko
2019-12-22 17:59   ` Vladislav Shpilevoy
2019-12-23 22:10     ` Sergey Petrenko
2019-12-24 15:50       ` Vladislav Shpilevoy
2019-12-15 20:58 ` [Tarantool-patches] [PATCH 4/5] vclock: ignore 0th component in comparisons sergepetrenko
2019-12-22 17:59   ` Vladislav Shpilevoy
2019-12-23 21:26     ` Sergey Petrenko
2019-12-23 22:58       ` Sergey Petrenko
2019-12-26  4:43   ` Konstantin Osipov
2019-12-26  5:02     ` Konstantin Osipov
2019-12-27 12:56       ` Sergey Petrenko
2019-12-27 13:31         ` Konstantin Osipov
2019-12-27 13:48           ` Sergey Petrenko
2019-12-27 14:40             ` Konstantin Osipov
2019-12-15 20:58 ` [Tarantool-patches] [PATCH 5/5] replication: introduce anonymous replica sergepetrenko
2019-12-16 13:28   ` Serge Petrenko
2019-12-20 12:06     ` Serge Petrenko
2019-12-22 17:58   ` Vladislav Shpilevoy
2019-12-25 12:40     ` Sergey Petrenko
2019-12-25 18:23       ` Vladislav Shpilevoy [this message]
2019-12-26 16:08         ` Sergey Petrenko
2019-12-15 21:00 ` [Tarantool-patches] [PATCH 0/5] introduce anonymous replicas Sergey Petrenko
2019-12-18  7:49 ` Georgy Kirichenko
2019-12-20 12:07   ` Serge Petrenko
2019-12-20 12:17     ` Serge Petrenko
2019-12-22 17:59 ` Vladislav Shpilevoy

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=b42173d3-a47e-1ebe-8fc0-92b12d7f3910@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=georgy@tarantool.org \
    --cc=sergepetrenko@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 5/5] replication: introduce anonymous replica.' \
    /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