Skip to content

Commit 4587f3b

Browse files
committed
Add ro_reason field
1 parent ffd359a commit 4587f3b

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

doc/reference/reference_lua/box_info.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ variables.
3131
* **ro** is ``true`` if the instance is in "read-only" mode
3232
(same as :ref:`read_only <cfg_basic-read_only>` in ``box.cfg{}``),
3333
or if status is 'orphan'.
34+
* **ro_reason** is ``nil`` if the instance is in writable mode.
35+
When the field is ``true``, it reports an error reason.
3436
* **signature** is the sum of all ``lsn`` values from each :ref:`vector clock <replication-vector>`
3537
(**vclock**) for all instances in the replica set.
3638
* **sql().cache.size** is the number of bytes in the SQL prepared statement cache.
@@ -56,7 +58,7 @@ variables.
5658
* **election** shows the current state of a replica set node regarding leader
5759
election (see :doc:`here </reference/reference_lua/box_info/election>`).
5860

59-
Below is a list of all ``box.info`` functions.
61+
Below is a list of all ``box.info`` functions and members.
6062

6163
.. container:: table
6264

@@ -95,6 +97,8 @@ Below is a list of all ``box.info`` functions.
9597
* - :doc:`./box_info/synchro`
9698
- Show the current state of synchronous replication
9799

100+
* - :doc:`./box_info/ro_reason`
101+
- List of all error reasons for the ``box.info.ro_reason`` field
98102

99103
.. toctree::
100104
:hidden:
@@ -107,3 +111,4 @@ Below is a list of all ``box.info`` functions.
107111
box_info/listen
108112
box_info/election
109113
box_info/synchro
114+
box_info/ro_reason
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
.. _box_info_ro-reason:
2+
3+
================================================================================
4+
box.info.ro_reason
5+
================================================================================
6+
7+
.. module:: box.info
8+
9+
Possible error reasons:
10+
11+
* ``election`` -- the instance is not a leader.
12+
That is, ``box.cfg.election_mode`` is not ``off``.
13+
See :ref:`box.info.election <box_info_election>` for details.
14+
15+
* ``synchro`` -- the instance is not the owner of the synchronous transaction queue.
16+
For details, see :ref:`box.info.synchro <box_info_synchro>`.
17+
18+
* ``config`` -- the server instance is in read-only mode.
19+
That is, :ref:`box.cfg.read_only <cfg_basic-read_only>` is ``true``.
20+
21+
* ``orphan`` -- the instance is in ``orphan`` state.
22+
For details, see :ref:`the orphan status page <internals-replication-orphan_status>`.

0 commit comments

Comments
 (0)