Skip to content

Commit d145496

Browse files
committed
Update box.info()
1 parent fa48d0a commit d145496

26 files changed

+519
-157
lines changed

doc/reference/reference_lua/box_info.rst

Lines changed: 91 additions & 72 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,7 +15,7 @@ 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
@@ -77,44 +24,116 @@ Below is a list of all ``box.info`` functions and members.
7724
* - :doc:`./box_info/info`
7825
- Return all keys and values provided in the submodule
7926

27+
* - :doc:`./box_info/cluster`
28+
- Get information about the cluster the current instance belongs to
29+
30+
* - :doc:`./box_info/config`
31+
- Get the current instance's state in regard to configuration
32+
33+
* - :doc:`./box_info/election`
34+
- Show the current state of a replica set node in regards to leader election
35+
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+
- Get the hostname 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+
- Return 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
8553

86-
* - :doc:`./box_info/replication_anon`
87-
- List all the anonymous replicas following the instance
54+
* - :doc:`./box_info/name`
55+
- Get the name of the current instance
56+
57+
* - :doc:`./box_info/package`
58+
- Get the package name
59+
60+
* - :doc:`./box_info/pid`
61+
- Get a process ID for the current instance
62+
63+
* - :doc:`./box_info/replicaset`
64+
- Get information about the replica set the current instance belongs to
8865

8966
* - :doc:`./box_info/replication`
9067
- Return statistics for all instances in the replica set
9168

92-
* - :doc:`./box_info/listen`
93-
- Return a real address to which an instance was bound
94-
95-
* - :doc:`./box_info/election`
96-
- Show the current state of a replica set node
97-
in regards to leader election
69+
* - :doc:`./box_info/replication_anon`
70+
- List all the anonymous replicas following the instance
9871

99-
* - :doc:`./box_info/synchro`
100-
- Show the current state of synchronous replication
72+
* - :doc:`./box_info/ro`
73+
- Show the current mode of an instance (writable or read-only)
10174

10275
* - :doc:`./box_info/ro_reason`
103-
- Show the current mode of an instance (writable or read-only)
76+
- Get the reason why the instance is read-only
10477

10578
* - :doc:`./box_info/schema_version`
10679
- Show the database schema version
10780

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+
- Get the current state of the instance
89+
90+
* - :doc:`./box_info/synchro`
91+
- Show the current state of synchronous replication
92+
93+
* - :doc:`./box_info/uptime`
94+
- The number of seconds since the instance started
95+
96+
* - :doc:`./box_info/uuid`
97+
- Get 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
107+
108+
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+
Get information about the cluster the current instance belongs to.
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+
Get the current instance's state in regard to configuration.
14+
Note that ``box.info.config`` returns an 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+
...

doc/reference/reference_lua/box_info/gc.rst

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,17 @@ box.info.gc()
88

99
.. function:: gc()
1010

11-
The **gc** function of ``box.info`` gives the ``admin`` user a
12-
picture of the factors that affect the
13-
:ref:`Tarantool garbage collector <cfg_checkpoint_daemon-garbage-collector>`.
11+
Get information about the :ref:`Tarantool garbage collector <configuration_persistence_garbage_collector>`.
1412
The garbage collector compares vclock (:ref:`vector clock <replication-vector>`)
1513
values of users and checkpoints, so a look at ``box.info.gc()`` may show why the
1614
garbage collector has not removed old WAL files, or show what it may soon remove.
1715

18-
* **gc().consumers** -- a list of users whose requests might affect the garbage collector.
19-
* **gc().checkpoints** -- a list of preserved checkpoints.
20-
* **gc().checkpoints[n].references** -- a list of references to a checkpoint.
21-
* **gc().checkpoints[n].vclock** -- a checkpoint's vclock value.
22-
* **gc().checkpoints[n].signature** -- a sum of a checkpoint's vclock's components.
23-
* **gc().checkpoint_is_in_progress** -- true if a checkpoint is in progress, otherwise false
24-
* **gc().vclock** -- the garbage collector's vclock.
25-
* **gc().signature** -- the sum of the garbage collector's checkpoint's components.
26-
* **gc().wal_retention_vclock** -- a vclock value of the oldest write-ahead log file protected from removing by the garbage collector by using the :ref:`wal.retention_period <configuration_reference_wal_retention_period>` option.
16+
* ``consumers`` -- a list of users whose requests might affect the garbage collector.
17+
* ``checkpoints`` -- a list of preserved checkpoints.
18+
* ``checkpoints[n].references`` -- a list of references to a checkpoint.
19+
* ``checkpoints[n].vclock`` -- a checkpoint's vclock value.
20+
* ``checkpoints[n].signature`` -- a sum of a checkpoint's vclock's components.
21+
* ``checkpoint_is_in_progress`` -- true if a checkpoint is in progress, otherwise false
22+
* ``vclock`` -- the garbage collector's vclock.
23+
* ``signature`` -- the sum of the garbage collector's checkpoint's components.
24+
* ``wal_retention_vclock`` -- a vclock value of the oldest write-ahead log file protected from removing by the garbage collector by using the :ref:`wal.retention_period <configuration_reference_wal_retention_period>` option.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.. _box_info_hostname:
2+
3+
================================================================================
4+
box.info.hostname
5+
================================================================================
6+
7+
.. module:: box.info
8+
9+
.. data:: hostname
10+
11+
Since: :doc:`3.2.0 </release/3.2.0>`
12+
13+
Get the hostname the current instance is running on.
14+
15+
:rtype: string
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.. _box_info_id:
2+
3+
================================================================================
4+
box.info.id
5+
================================================================================
6+
7+
.. module:: box.info
8+
9+
.. data:: id
10+
11+
A numeric identifier of the current instance within the replica set.
12+
This value corresponds to ``replication[{n}].id``.
13+
Learn more in :ref:`box_info_replication`.
14+
15+
:rtype: number

0 commit comments

Comments
 (0)