Skip to content

[5pt] vshard.storage.enable/disable() #2510

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Tracked by #2640
TarantoolBot opened this issue Dec 20, 2021 · 0 comments
Open
Tracked by #2640

[5pt] vshard.storage.enable/disable() #2510

TarantoolBot opened this issue Dec 20, 2021 · 0 comments
Labels
ecosystem [area] Task relates to Tarantool's ecosystem (connector, module, other non-server functionality) feature A new functionality vshard [area] Related to vshard module

Comments

@TarantoolBot
Copy link
Collaborator

TarantoolBot commented Dec 20, 2021

Product: Tarantool, vshard
Root document: https://www.tarantool.io/en/doc/latest/reference/reference_rock/vshard/vshard_api/
SME: @ Gerold103

Seems the description of the vshard.storage.disable()/enable() functions is missing in the reference. Need to add sections for those functions including the info below in Details.

Details

vshard.storage.disable() makes most of the vshard.storage
functions throw an error. As Lua exception, not via nil, err
pattern.

vshard.storage.enable() reverts the disable.

By default the storage is enabled.

Additionally, the storage is forcefully disabled automatically
until vshard.storage.cfg() is finished and the instance finished
recovery (its box.info.status is 'running', for example).

Auto-disable protects from usage of vshard functions before the
storage's global state is fully created.

Manual vshard.storage.disable() helps to achieve the same for
user's application. For instance, a user might want to do some
preparatory work after vshard.storage.cfg before the application
is ready for requests. Then the flow would be:

vshard.storage.disable()
vshard.storage.cfg(...)
-- Do your preparatory work here ...
vshard.storage.enable()

The routers handle the errors signaling about the storage being disabled in a
special way. They put connections to such instances into a backoff state for
some time and will try to use other replicas. For example, assume a replicaset
has replicas 'replica_1' and 'replica_2'. Assume 'replica_1' is disabled due to
any reason. If a router will try to talk to 'replica_1', it will get a special
error and will transparently retry to 'replica_2'.

When 'replica_1' is enabled again, the router will notice it too and will send
requests to it again.

It all works exclusively for read-only requests. Read-write requests can only be
sent to a master, which is one per replicaset. They are not retried.
Requested by @Gerold103 in tarantool/vshard@2eb17c4.

More info: tarantool/vshard@5d935fc

@veod32 veod32 added ecosystem [area] Task relates to Tarantool's ecosystem (connector, module, other non-server functionality) vshard [area] Related to vshard module feature A new functionality labels Jan 11, 2022
@veod32 veod32 changed the title vshard.storage.enable/disable() [5pt] vshard.storage.enable/disable() Jan 11, 2022
@veod32 veod32 added this to the vshard milestone Jan 11, 2022
@patiencedaur patiencedaur mentioned this issue Feb 1, 2022
21 tasks
@patiencedaur patiencedaur removed this from the vshard milestone Feb 1, 2022
@TarantoolBot TarantoolBot removed the 5sp label Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ecosystem [area] Task relates to Tarantool's ecosystem (connector, module, other non-server functionality) feature A new functionality vshard [area] Related to vshard module
Projects
None yet
Development

No branches or pull requests

3 participants