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
[from the commit message]:
ER_READONLY used not to have any details about the exact reason
why the instance is read-only. The patch changes that by adding
new fields into the error which explain why the error happened and
even help to avoid it for next requests.
[input from the TarantoolBot]:
Users could see the error code as box.error.READONLY in .code
field of an error object. The error didn't have any other
attributes except common ones like 'type'.
Now from the box.error.READONLY error users can see why it
happened. The reasons can be the following:
The instance has box.cfg.read_only = true. Then the READONLY
error has at least these fields:
The instance is an orphan. It enters that state if number of
connected replicas is < box.cfg.replication_connect_quorum. Then READONLY error has at least these fields:
The synchro queue has an owner which is not the given instance.
It usually happens if synchronous replication is used and there is
another instance who called box.ctl.promote(). Then READONLY
error has at least these fields:
tarantool> err:unpack()
---
- queue_owner_id: <box.info.id of the queue owner>
queue_owner_uuid: <box.info.uuid of the queue owner>
reason: synchro
term: <last known box.info.election.term of the owner>
code: 7
type: ClientError
...
Note than queue_owner_uuid sometimes might be not present.
The instance has box.cfg.election_mode not off and it is not
a leader. Then READONLY error has at least these fields:
tarantool> err:unpack()
---
- state: <box.info.election.state of this instance>
leader_id: <box.info.id of the leader>
leader_uuid: <box.info.uuid of the leader>
reason: election
term: <box.info.election.term of this instance>
code: 7
type: ClientError
...
leader_id and leader_uuid might be absent if the leader is not
known. For example, an election is still in progress. Note, than leader_uuid sometimes might be not present even if leader_id
is.
If multiple reasons are true at the same time, then only one is
returned in the following order of preference: election, synchro,
config, orphan.
Requested by @Gerold103 in tarantool/tarantool@f57b314
ToDo
Describe the new field of the error object -- .reason -- that is for the ER_READONLY error only.
Make a link to the description of the box.info.ro_reason ([3pt] box.info.ro_reason #2445): error_object.reason is the same as the box.info.ro_reason at the moment of throwing the error.
The text was updated successfully, but these errors were encountered:
veod32
changed the title
box.error.READONLY new attributes
[3pt] box.error.READONLY new attributes
Dec 29, 2021
veod32
added
server
[area] Task relates to Tarantool's server (core) functionality
reference
[location] Tarantool manual, Reference part
feature
A new functionality
labels
Dec 29, 2021
Product: Tarantool
Since: 2.10.0-beta2
Audience/target: Tarantool users
Root document: https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_error/error_object/
SME: @ Gerold103
Related to: #2445
Details
[from the commit message]:
ER_READONLY used not to have any details about the exact reason
why the instance is read-only. The patch changes that by adding
new fields into the error which explain why the error happened and
even help to avoid it for next requests.
[input from the TarantoolBot]:
Users could see the error code as
box.error.READONLY
in.code
field of an error object. The error didn't have any other
attributes except common ones like 'type'.
Now from the
box.error.READONLY
error users can see why ithappened. The reasons can be the following:
box.cfg.read_only = true
. Then theREADONLY
error has at least these fields:
connected replicas is <
box.cfg.replication_connect_quorum
. ThenREADONLY
error has at least these fields:It usually happens if synchronous replication is used and there is
another instance who called
box.ctl.promote()
. ThenREADONLY
error has at least these fields:
Note than
queue_owner_uuid
sometimes might be not present.box.cfg.election_mode
notoff
and it is nota leader. Then
READONLY
error has at least these fields:leader_id
andleader_uuid
might be absent if the leader is notknown. For example, an election is still in progress. Note, than
leader_uuid
sometimes might be not present even ifleader_id
is.
If multiple reasons are true at the same time, then only one is
returned in the following order of preference: election, synchro,
config, orphan.
Requested by @Gerold103 in tarantool/tarantool@f57b314
ToDo
.reason
-- that is for theER_READONLY
error only.box.info.ro_reason
([3pt] box.info.ro_reason #2445):error_object.reason
is the same as thebox.info.ro_reason
at the moment of throwing the error.The text was updated successfully, but these errors were encountered: