Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: Yaroslav Dynnikov <yaroslav.dynnikov@tarantool.org>
Cc: tml <tarantool-patches@dev.tarantool.org>
Subject: Re: [Tarantool-patches] [PATCH vshard 1/1] storage: allow replica to boot before master
Date: Thu, 6 Aug 2020 00:15:46 +0200	[thread overview]
Message-ID: <e8c615ef-88b3-ed8d-d2a2-3c37029f46d1@tarantool.org> (raw)
In-Reply-To: <CAK0MaD2AVy21HLjc=QAG7WG0xcqFAwXPy-CFsryjOOD4nrod4g@mail.gmail.com>

Thanks for the review!

>         diff --git a/vshard/storage/init.lua b/vshard/storage/init.lua
>         index c6a78fe..ed577f9 100644
>         --- a/vshard/storage/init.lua
>         +++ b/vshard/storage/init.lua
>         @@ -2435,8 +2446,11 @@ local function storage_cfg(cfg, this_replica_uuid, is_reload)
>              local uri = luri.parse(this_replica.uri)
>              schema_upgrade(is_master, uri.login, uri.password)
> 
>         -    local old_trigger = box.space._bucket:on_replace()[1]
>         -    box.space._bucket:on_replace(bucket_generation_increment, old_trigger)
>         +    if is_master then
>         +        local old_trigger = M.bucket_on_replace
>         +        box.space._bucket:on_replace(bucket_generation_increment, old_trigger)
>         +        M.bucket_on_replace = bucket_generation_increment
>         +    end
> 
> 
> It seems that the trigger is never removed. If a replica was a master some time ago, it still has the trigger.
> Is it safe?

Yes, it is. The trigger only increments a counter in M. And the counter is
not used for anything out of the node. It should be just locally monotonic.
So it is ok to increment it even on replica. After all this is how it
worked before.

But again, after this comment I had second thoughts, and decided to remove the
trigger when switched to replica to be consistent. See v2 in a new mail thread.

  reply	other threads:[~2020-08-05 22:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-04 21:04 Vladislav Shpilevoy
2020-08-04 22:45 ` Yaroslav Dynnikov
2020-08-05  9:46   ` Yaroslav Dynnikov
2020-08-05 22:15     ` Vladislav Shpilevoy [this message]
2020-08-05 22:15   ` 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=e8c615ef-88b3-ed8d-d2a2-3c37029f46d1@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --cc=yaroslav.dynnikov@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH vshard 1/1] storage: allow replica to boot before master' \
    /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