Tarantool development patches archive
 help / color / mirror / Atom feed
From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Sergey Kaplun <skaplun@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org,
	Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Subject: Re: [Tarantool-patches] [DRAFT v2] replication: track information about replica
Date: Tue, 7 Jul 2020 14:50:24 +0300	[thread overview]
Message-ID: <20200707115024.GA1999@grain> (raw)
In-Reply-To: <20200706142654.GM2256@grain>

On Mon, Jul 06, 2020 at 05:26:54PM +0300, Cyrill Gorcunov wrote:
> On Thu, Jul 02, 2020 at 11:21:41PM +0300, Sergey Kaplun wrote:
> > This is a draft for the patch.
> > The patch allows to track information about changing relay state. At
> > every change of relay state timestamp, vclock, new state (and error
> > message if exists) will be saved at _cluster space.
> > 
> > The patch adds trigger list at relay, that is invoked when relay changes
> > its state.  The trigger that updates _cluster space is setted when a
> > replica is registered.
> > ---

Sergey, let me start from my understanding of a problem and correct
me if I'm wrong in my assumptions please.

Currently (master banch) information about replicas fetched from
lbox_info_replication
---
replicaset_foreach(replica) {
	...
	lbox_pushreplica(L, replica);
		lua_pushinteger(L, replica->id);
		lua_pushstring(L, tt_uuid_str(&replica->uuid));
		luaL_pushuint64(L, vclock_get(&replicaset.vclock, replica->id));
		lua_pushstring(L, "upstream");
			lbox_pushapplier(L, applier);
		lua_pushstring(L, "downstream");
			lbox_pushrelay(L, relay);
---

IOW everytime we call info method the information is fetched from run-time
variables.

Now we wanna get more information about relays (their ip:port, vclock,
timestamp, state and etc).

So we extend system "_cluster" table for this sake (currently _cluster
table consists of replica-id:uuid pairs). Note that this pairs are
transparent to all nodes in the cluster and strictly speaking not
bound to ip, vclocks and etc. Moreover I've heaard that we're
about to replicate the _cluster table itself in sake of qsync
(but I might be wrong here and Vlad should know more).

Thus it looks to me that extending this _cluster table for additional
data is somewhat close to a big hammer. From the bug decription seems
the main idea is to be able to rip off dead replicas which sounds
reasonable but definitely not addressed in this patch. Taking into
account that it is early RFC I think it is just fine.

Still I don't understand why we're updating _cluster from the trigger,
can't we do that from relay_start/stop routines directly without using
triggers at all? Or here is a problem with the fact that relays are
separate threads?

      reply	other threads:[~2020-07-07 11:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-02 20:21 Sergey Kaplun
2020-07-06 14:26 ` Cyrill Gorcunov
2020-07-07 11:50   ` Cyrill Gorcunov [this message]

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=20200707115024.GA1999@grain \
    --to=gorcunov@gmail.com \
    --cc=skaplun@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [DRAFT v2] replication: track information about 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