Skip to content

Commit 9e57f6c

Browse files
Update docs for the 'box.info' module (#4427)
1 parent cdfd4db commit 9e57f6c

30 files changed

+636
-165
lines changed

doc/reference/configuration/cfg_replication.rst

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
* :ref:`election_mode <cfg_replication-election_mode>`
1717
* :ref:`election_timeout <cfg_replication-election_timeout>`
1818
* :ref:`election_fencing_mode <cfg_replication-election_fencing_mode>`
19+
* :ref:`instance_name <cfg_replication-instance_name>`
20+
* :ref:`replicaset_name <cfg_replication-replicaset_name>`
21+
* :ref:`cluster_name <cfg_replication-cluster_name>`
22+
1923

2024
.. _cfg_replication-replication:
2125

@@ -708,3 +712,87 @@
708712
| Default: 'soft'
709713
| Environment variable: TT_ELECTION_FENCING_MODE
710714
| Dynamic: yes
715+
716+
.. _cfg_replication-instance_name:
717+
718+
.. confval:: instance_name
719+
720+
Since version :doc:`3.0.0 </release/3.0.0>`.
721+
722+
Specify the instance name.
723+
This value must be unique in a replica set.
724+
725+
The following rules are applied to instance names:
726+
727+
- The maximum number of symbols is 63.
728+
- Should start with a letter.
729+
- Can contain lowercase letters (a-z). If uppercase letters are used, they are converted to lowercase.
730+
- Can contain digits (0-9).
731+
- Can contain the following characters: ``-``, ``_``.
732+
733+
To change or remove the specified name, you should temporarily set the :ref:`box.cfg.force_recovery <cfg_binary_logging_snapshots-force_recovery>` configuration option to ``true``.
734+
When all the names are updated and all the instances synced, ``box.cfg.force_recovery`` can be set back to ``false``.
735+
736+
.. NOTE::
737+
738+
The instance name is persisted in the :ref:`box.space._cluster <box_space-cluster>` system space.
739+
740+
See also: :ref:`box_info_name`
741+
742+
|
743+
| Type: string
744+
| Default: null
745+
| Environment variable: TT_INSTANCE_NAME
746+
| Dynamic: no
747+
748+
.. _cfg_replication-replicaset_name:
749+
750+
.. confval:: replicaset_name
751+
752+
Since version :doc:`3.0.0 </release/3.0.0>`.
753+
754+
Specify the name of a replica set to which this instance belongs.
755+
This value must be the same for all instances of the replica set.
756+
757+
See the :ref:`instance_name <cfg_replication-instance_name>` description to learn:
758+
759+
- which rules are applied to names
760+
- how to change or remove an already specified name
761+
762+
.. NOTE::
763+
764+
The replica set name is persisted in the :ref:`box.space._schema <box_space-schema>` system space.
765+
766+
See also: :ref:`box_info_replicaset`
767+
768+
|
769+
| Type: string
770+
| Default: null
771+
| Environment variable: TT_REPLICASET_NAME
772+
| Dynamic: no
773+
774+
.. _cfg_replication-cluster_name:
775+
776+
.. confval:: cluster_name
777+
778+
Since version :doc:`3.0.0 </release/3.0.0>`.
779+
780+
Specify the name of a cluster to which this instance belongs.
781+
This value must be the same for all instances of the cluster.
782+
783+
See the :ref:`instance_name <cfg_replication-instance_name>` description to learn:
784+
785+
- which rules are applied to names
786+
- how to change or remove an already specified name
787+
788+
.. NOTE::
789+
790+
The cluster name is persisted in the :ref:`box.space._schema <box_space-schema>` system space.
791+
792+
See also: :ref:`box_info_cluster`
793+
794+
|
795+
| Type: string
796+
| Default: null
797+
| Environment variable: TT_CLUSTER_NAME
798+
| Dynamic: no

doc/reference/configuration/configuration_reference.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2582,6 +2582,14 @@ The ``groups`` section provides the ability to define the :ref:`full topology of
25822582

25832583
A group name.
25842584

2585+
The following rules are applied to group names:
2586+
2587+
- The maximum number of symbols is 63.
2588+
- Should start with a letter.
2589+
- Can contain lowercase letters (a-z).
2590+
- Can contain digits (0-9).
2591+
- Can contain the following characters: ``-``, ``_``.
2592+
25852593
.. _configuration_reference_groups_name_replicasets:
25862594

25872595
.. confval:: groups.<group_name>.replicasets
@@ -2616,6 +2624,9 @@ replicasets
26162624

26172625
A replica set name.
26182626

2627+
Note that the rules applied to a replica set name are the same as for groups.
2628+
Learn more in :ref:`groups.\<group_name\> <configuration_reference_groups_name>`.
2629+
26192630
.. _configuration_reference_replicasets_name_leader:
26202631

26212632
.. confval:: replicasets.<replicaset_name>.leader
@@ -2679,6 +2690,9 @@ instances
26792690

26802691
An instance name.
26812692

2693+
Note that the rules applied to an instance name are the same as for groups.
2694+
Learn more in :ref:`groups.\<group_name\> <configuration_reference_groups_name>`.
2695+
26822696
.. _configuration_reference_instances_name_config_parameter:
26832697

26842698
.. confval:: instances.<instance_name>.<config_parameter>

doc/reference/reference_lua/box_info.rst

Lines changed: 93 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -6,60 +6,7 @@ Submodule box.info
66

77
.. module:: box.info
88

9-
The ``box.info`` submodule provides access to information about server instance
10-
variables.
11-
12-
* **cluster.uuid** is the UUID of the replica set.
13-
Every instance in a replica set will have the same ``cluster.uuid`` value.
14-
This value is also stored in :ref:`box.space._schema <box_space-schema>`
15-
system space.
16-
* **gc()** returns the state of the
17-
:ref:`Tarantool garbage collector <cfg_checkpoint_daemon-garbage-collector>`
18-
including the checkpoints and their consumers (users); see details
19-
:doc:`here </reference/reference_lua/box_info/gc>`.
20-
* **id** corresponds to :samp:`replication[{n}].id`
21-
(see :doc:`here </reference/reference_lua/box_info/replication>`).
22-
* **lsn** corresponds to :samp:`replication[{n}].lsn`
23-
(see :doc:`here </reference/reference_lua/box_info/replication>`).
24-
* **listen** returns a real address to which an instance was bound
25-
(see :doc:`here </reference/reference_lua/box_info/listen>`).
26-
* **memory()** returns the statistics about memory
27-
(see :doc:`here </reference/reference_lua/box_info/memory>`).
28-
* **pid** is the process ID. This value is also shown by
29-
:ref:`tarantool <tarantool-build>` module
30-
and by the Linux command ``ps -A``.
31-
* **ro** is ``true`` if the instance is in read-only mode
32-
(same as :ref:`read_only <cfg_basic-read_only>` in ``box.cfg{}``),
33-
or if status is 'orphan'.
34-
* **ro_reason** is ``nil`` if the instance is in writable mode.
35-
When the field is not ``nil``, it contains the reason why the instance is read-only.
36-
Possible error reasons: ``election``, ``synchro``, ``config``, and ``orphan``
37-
(see :ref:`box.info.ro_reason <box_info_ro-reason>` for details).
38-
* **signature** is the sum of all ``lsn`` values from each :ref:`vector clock <replication-vector>`
39-
(**vclock**) for all instances in the replica set.
40-
* **sql().cache.size** is the number of bytes in the SQL prepared statement cache.
41-
* **sql().cache.stmt_count** is the number of statements in the SQL prepared statement cache.
42-
* **status** is the current state of the instance. It can be:
43-
44-
* ``running`` -- the instance is loaded,
45-
* ``loading`` -- the instance is either recovering xlogs/snapshots or bootstrapping,
46-
* ``orphan`` -- the instance has not (yet) succeeded in joining the required
47-
number of masters (see :ref:`orphan status <replication-orphan_status>`),
48-
* ``hot_standby`` -- the instance is :ref:`standing by <index-hot_standby>` another instance.
49-
* **uptime** is the number of seconds since the instance started.
50-
This value can also be retrieved with
51-
:ref:`tarantool.uptime() <tarantool-build>`.
52-
* **uuid** corresponds to :samp:`replication[{n}].uuid`
53-
(see :doc:`here </reference/reference_lua/box_info/replication>`).
54-
* **vclock** is a table with the vclock values of all instances in a replica set which have made data changes.
55-
* **version** is the Tarantool version. This value is also shown by
56-
:ref:`tarantool -V <index-tarantool_version>`.
57-
* **vinyl()** returns runtime statistics for the vinyl storage engine.
58-
This function is deprecated, use
59-
:ref:`box.stat.vinyl() <box_introspection-box_stat_vinyl>` instead.
60-
* **election** shows the current state of a replica set node regarding leader
61-
election (see :doc:`here </reference/reference_lua/box_info/election>`).
62-
9+
The ``box.info`` submodule provides access to information about a running Tarantool instance.
6310
Below is a list of all ``box.info`` functions and members.
6411

6512
.. container:: table
@@ -68,53 +15,125 @@ Below is a list of all ``box.info`` functions and members.
6815
.. rst-class:: left-align-column-2
6916

7017
.. list-table::
71-
:widths: 25 75
18+
:widths: 30 70
7219
:header-rows: 1
7320

7421
* - Name
7522
- Use
7623

7724
* - :doc:`./box_info/info`
78-
- Return all keys and values provided in the submodule
25+
- Get all keys and values provided by the ``box.info`` submodule
26+
27+
* - :doc:`./box_info/cluster`
28+
- Information about the cluster to which the current instance belongs
29+
30+
* - :doc:`./box_info/config`
31+
- The instance's state in regard to configuration
32+
33+
* - :doc:`./box_info/election`
34+
- The current state of this replica set node in regard to leader election
7935

8036
* - :doc:`./box_info/gc`
81-
- Return info about garbage collector
37+
- Get information about the Tarantool garbage collector
38+
39+
* - :doc:`./box_info/hostname`
40+
- The hostname that identifies a machine the current instance is running on
41+
42+
* - :doc:`./box_info/id`
43+
- A numeric identifier of the current instance within the replica set
44+
45+
* - :doc:`./box_info/listen`
46+
- A real address to which an instance is bound
47+
48+
* - :doc:`./box_info/lsn`
49+
- A log sequence number (LSN) for the latest entry in the instance's write-ahead log (WAL)
8250

8351
* - :doc:`./box_info/memory`
84-
- Return info about memory usage
52+
- Get information about memory usage for the current instance
53+
54+
* - :doc:`./box_info/name`
55+
- The name of the current instance
56+
57+
* - :doc:`./box_info/package`
58+
- The package name
59+
60+
* - :doc:`./box_info/pid`
61+
- Get a process ID of the current instance
62+
63+
* - :doc:`./box_info/replicaset`
64+
- Information about the replica set to which the current instance belongs
65+
66+
* - :doc:`./box_info/replication`
67+
- Statistics for all instances in the replica set
8568

8669
* - :doc:`./box_info/replication_anon`
8770
- List all the anonymous replicas following the instance
8871

89-
* - :doc:`./box_info/replication`
90-
- Return statistics for all instances in the replica set
72+
* - :doc:`./box_info/ro`
73+
- The current mode of the instance (writable or read-only)
9174

92-
* - :doc:`./box_info/listen`
93-
- Return a real address to which an instance was bound
75+
* - :doc:`./box_info/ro_reason`
76+
- The reason why the current instance is read-only
9477

95-
* - :doc:`./box_info/election`
96-
- Show the current state of a replica set node
97-
in regards to leader election
78+
* - :doc:`./box_info/schema_version`
79+
- The database schema version
80+
81+
* - :doc:`./box_info/signature`
82+
- The sum of all ``lsn`` values from each vector clock for all instances in the replica set
83+
84+
* - :doc:`./box_info/sql`
85+
- Get information about the cache for all SQL prepared statements
86+
87+
* - :doc:`./box_info/status`
88+
- The current state of the instance
9889

9990
* - :doc:`./box_info/synchro`
100-
- Show the current state of synchronous replication
91+
- The current state of synchronous replication
10192

102-
* - :doc:`./box_info/ro_reason`
103-
- Show the current mode of an instance (writable or read-only)
93+
* - :doc:`./box_info/uptime`
94+
- The number of seconds since the instance started
95+
96+
* - :doc:`./box_info/uuid`
97+
- A globally unique identifier of the current instance
98+
99+
* - :doc:`./box_info/vclock`
100+
- A table with the vclock values of all instances in a replica set which have made data changes
101+
102+
* - :doc:`./box_info/version`
103+
- The Tarantool version
104+
105+
* - :doc:`./box_info/vinyl`
106+
- (Deprecated) Get runtime statistics for the vinyl storage engine
104107

105-
* - :doc:`./box_info/schema_version`
106-
- Show the database schema version
107108

108109
.. toctree::
109110
:hidden:
110111

111112
box_info/info
113+
box_info/cluster
114+
box_info/config
115+
box_info/election
112116
box_info/gc
117+
box_info/hostname
118+
box_info/id
119+
box_info/listen
120+
box_info/lsn
113121
box_info/memory
114-
box_info/replication_anon
122+
box_info/name
123+
box_info/package
124+
box_info/pid
125+
box_info/replicaset
115126
box_info/replication
116-
box_info/listen
117-
box_info/election
118-
box_info/synchro
127+
box_info/replication_anon
128+
box_info/ro
119129
box_info/ro_reason
120130
box_info/schema_version
131+
box_info/signature
132+
box_info/sql
133+
box_info/status
134+
box_info/synchro
135+
box_info/uptime
136+
box_info/uuid
137+
box_info/vclock
138+
box_info/version
139+
box_info/vinyl
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
.. _box_info_cluster:
2+
3+
================================================================================
4+
box.info.cluster
5+
================================================================================
6+
7+
.. module:: box.info
8+
9+
.. data:: cluster
10+
11+
Information about the cluster to which the current instance belongs.
12+
The returned table contains the following fields:
13+
14+
* ``name`` -- the cluster name
15+
16+
See also: :ref:`compat.box_info_cluster_meaning <configuration_reference_compat_cluster_meaning>`
17+
18+
:rtype: table
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
.. _box_info_config:
2+
3+
================================================================================
4+
box.info.config
5+
================================================================================
6+
7+
.. module:: box.info
8+
9+
.. data:: config
10+
11+
Since: :doc:`3.2.0 </release/3.2.0>`
12+
13+
The instance's state in regard to configuration.
14+
Note that ``box.info.config`` returns the instance's state obtained using :ref:`config:info('v2') <config_api_reference_info>`.
15+
16+
:rtype: table
17+
18+
**Example**
19+
20+
.. code-block:: tarantoolsession
21+
22+
sharded_cluster_crud:storage-a-002> box.info.config
23+
---
24+
- status: ready
25+
meta:
26+
last: &0 []
27+
active: *0
28+
alerts: []
29+
...

0 commit comments

Comments
 (0)