You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TarantoolBot opened this issue
Dec 20, 2021
· 0 comments
Labels
ecosystem[area] Task relates to Tarantool's ecosystem (connector, module, other non-server functionality)featureA new functionalityvshard[area] Related to vshard module
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.
The text was updated successfully, but these errors were encountered:
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
changed the title
vshard.storage.enable/disable()
[5pt] vshard.storage.enable/disable()
Jan 11, 2022
ecosystem[area] Task relates to Tarantool's ecosystem (connector, module, other non-server functionality)featureA new functionalityvshard[area] Related to vshard module
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 thevshard.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 finishedrecovery (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 foruser's application. For instance, a user might want to do some
preparatory work after
vshard.storage.cfg
before the applicationis ready for requests. Then the flow would be:
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
The text was updated successfully, but these errors were encountered: