Tarantool development patches archive
 help / color / mirror / Atom feed
From: Oleg Babin via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>,
	tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH vshard 1/5] router: backoff on some box errors
Date: Fri, 17 Dec 2021 14:09:27 +0300	[thread overview]
Message-ID: <ca307ebe-d666-f1f2-9f15-06b3accf883e@tarantool.org> (raw)
In-Reply-To: <9e5ff9cae03a55bf3cacc482449f19895360c80d.1639700518.git.v.shpilevoy@tarantool.org>

Thanks for your patch! LGTM. But I think tests should be extended a bit.

I see that tests cover AccessDenied error but I don't see that there is 
simple error()/assert() error check.

On 17.12.2021 03:25, Vladislav Shpilevoy wrote:
> Storage configuration takes time. Firstly, box.cfg{} which can be
> called before vshard.storage.cfg(). Secondly, vshard.storage.cfg()
> is not immediate as well.
>
> During that time accessing the storage is not safe. Attempts to
> call vshard.storage functions can return weird errors, or the
> functions can even be not available yet. They need to be created
> in _func and get access rights in _priv before becoming public.
>
> Routers used to forward errors like 'access denied error' and
> 'no such function' to users as is, treating them as critical.
>
> Not only it was confusing for users, but also could make an entire
> replicaset not available for requests - the connection to it is
> alive, so router would send all requests into it and they all
> would fail. Even if the replicaset has another instance which is
> perfectly functional.
>
> This patch handles such specific errors inside of the router. The
> faulty replicas are put into a 'backoff' state. They remain in it
> for some fixed time (5 seconds for now), new requests won't be
> sent to them until the time passes. Router will use other
> instances.
>
> Backoff is activated only for vshard.* functions. If the errors
> are about some user's function, it is considered a regular error.
> Because the router can't tell whether any side effects were done
> on the remote instance before the error happened. Hence can't
> retry to another node.
>
> For example, if access was denied to 'vshard.storage.call', then
> it is backoff. If inside of vshard.storage.call the access was
> denied to 'user_test_func', then it is not backoff.
>
> It all works for read-only requests exclusively of course. Because
> for read-write requests the instance is just one - master. Router
> does not have other options so backoff here wouldn't help.
>
> Part of #298
> ---
>   test/router/router2.result   | 237 +++++++++++++++++++++++++++++++++++
>   test/router/router2.test.lua |  97 ++++++++++++++
>   vshard/consts.lua            |   1 +
>   vshard/error.lua             |   8 +-
>   vshard/replicaset.lua        | 100 +++++++++++++--
>   vshard/router/init.lua       |   3 +-
>   6 files changed, 432 insertions(+), 14 deletions(-)

  reply	other threads:[~2021-12-17 11:09 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-17  0:25 [Tarantool-patches] [PATCH vshard 0/5] Router backoff, storage disable Vladislav Shpilevoy via Tarantool-patches
2021-12-17  0:25 ` [Tarantool-patches] [PATCH vshard 1/5] router: backoff on some box errors Vladislav Shpilevoy via Tarantool-patches
2021-12-17 11:09   ` Oleg Babin via Tarantool-patches [this message]
2021-12-17 23:10     ` Vladislav Shpilevoy via Tarantool-patches
2021-12-18 13:57       ` Oleg Babin via Tarantool-patches
2021-12-17  0:25 ` [Tarantool-patches] [PATCH vshard 2/5] storage: auto enable/disable Vladislav Shpilevoy via Tarantool-patches
2021-12-17 11:09   ` Oleg Babin via Tarantool-patches
2021-12-17 23:10     ` Vladislav Shpilevoy via Tarantool-patches
2021-12-18 13:58       ` Oleg Babin via Tarantool-patches
2021-12-17  0:25 ` [Tarantool-patches] [PATCH vshard 3/5] storage: manual enable/disable Vladislav Shpilevoy via Tarantool-patches
2021-12-17 11:09   ` Oleg Babin via Tarantool-patches
2021-12-17  0:25 ` [Tarantool-patches] [PATCH vshard 4/5] error: introduce from_string Vladislav Shpilevoy via Tarantool-patches
2021-12-17 11:09   ` Oleg Babin via Tarantool-patches
2021-12-17 23:10     ` Vladislav Shpilevoy via Tarantool-patches
2021-12-17  0:25 ` [Tarantool-patches] [PATCH vshard 5/5] router: backoff on storage being disabled Vladislav Shpilevoy via Tarantool-patches
2021-12-17 11:09   ` Oleg Babin via Tarantool-patches
2021-12-18 13:58 ` [Tarantool-patches] [PATCH vshard 0/5] Router backoff, storage disable Oleg Babin via Tarantool-patches
2021-12-20 23:52 ` Vladislav Shpilevoy 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=ca307ebe-d666-f1f2-9f15-06b3accf883e@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=olegrok@tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH vshard 1/5] router: backoff on some box errors' \
    /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