Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: Konstantin Osipov <kostja@tarantool.org>
Cc: tarantool-patches@freelists.org
Subject: [tarantool-patches] Re: [PATCH 2/2] swim: introduce generation
Date: Fri, 21 Jun 2019 21:03:31 +0200	[thread overview]
Message-ID: <9a45ac3e-0bf7-6aad-e673-494c1e20a8da@tarantool.org> (raw)
In-Reply-To: <20190621065358.GF18958@atlas>



On 21/06/2019 08:53, Konstantin Osipov wrote:
> * Vladislav Shpilevoy <v.shpilevoy@tarantool.org> [19/06/21 00:25]:
> 
> Generation and incarnation look and sound similar, so it is hard
> to tell which is which.
> 
> I'd like to suggest renaming 'generation' to 'epoch'.
> 
> "Age" would be a wrong name for a pair "epoch" + "incarnation".
> 
> Besides, swim's term for the counter is "incarnation", so I would
> stick to the swim terminology.
> 
> I suggest this:
> 
> struct swim_incarnation {
>     int64_t term; // Derived from RAFT word "term", persisted between restarts
>     int64_t version; // Reflects swim member state version
> };
> 
> I am open to alternatives too.
> 

Basically, you do not like that I kept generation out of incarnation.
I did it deliberately to emphasize that SWIM's incarnation is not the
same as our 'age'. Additionally, it allows not to change API and keep
incarnation as a simple number. If we say, that incarnation is a structure,
then I am not sure how to return it in public API. Split all methods
operating on incarnation in 2 parts?

Assume, that we decided to split, and can encapsulate everything inside
the incarnation.

'version' for volatile part sounds good. 'term' does not. Raft uses
'term' as a version of round, not a version of an instance. It is about
cluster state, not an instance state. 'epoch' is the same IMO. Furthermore,
both 'epoch' and 'term' are dynamic usually.

'Generation' was perfect - it means 'поколение'. And it is logically to
increment it only when an instance dies and starts again, and never
change during lifetime.

If you still think, that the complex incarnation is the best, I suggest

    incarnation = { generation, version }

It leads to the following changes in the API.

    - member:incarnation()
    + member:generation()
    + member:version()

Method event:is_new_incarnation() will return true if generation or
version are changed. To check which one a user will use

    event:is_new_version()
    event:is_new_generation()



But I think, that current 'age' solution is better. It allows to do
not touch core SWIM concept 'incarnation'.

I am waiting for your decision on what to do.

  reply	other threads:[~2019-06-21 19:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-20 21:23 [tarantool-patches] [PATCH 0/2] SWIM generation Vladislav Shpilevoy
2019-06-20 21:23 ` [tarantool-patches] [PATCH 1/2] swim: encapsulate incarnation behind 'age' Vladislav Shpilevoy
2019-06-20 21:23 ` [tarantool-patches] [PATCH 2/2] swim: introduce generation Vladislav Shpilevoy
2019-06-21  6:53   ` [tarantool-patches] " Konstantin Osipov
2019-06-21 19:03     ` Vladislav Shpilevoy [this message]
2019-06-21 19:48       ` Konstantin Osipov
2019-06-21 19:53         ` Konstantin Osipov
2019-06-21 22:00           ` Vladislav Shpilevoy
2019-06-21 22:31             ` Konstantin Osipov

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=9a45ac3e-0bf7-6aad-e673-494c1e20a8da@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=kostja@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [PATCH 2/2] swim: introduce generation' \
    /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