Skip to content

Adds hierarchy table description #5150

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions doc/reference/reference_lua/box_info/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ box.info.config
The instance's state in regard to configuration.
Note that ``box.info.config`` returns the instance's state obtained using :ref:`config:info('v2') <config_api_reference_info>`.

Since version :doc:`3.3.0 </release/3.3.0>` returns the ``hierarchy`` table, showing names of the group, replicaset, and the instance itself.
These names are taken directly from the ``--name`` CLI option (or the ``TT_INSTANCE_NAME`` environment variable)
and the cluster configuration. This means they are always present if the YAML configuration flow is in use,
disregarding the database status (whether upgraded, writable or not).

:rtype: table

**Example**
Expand All @@ -26,4 +31,8 @@ box.info.config
last: &0 []
active: *0
alerts: []
hierarchy:
group: storages
replicaset: storage-a
instance: storage-a-002
...
9 changes: 9 additions & 0 deletions doc/reference/reference_lua/box_info/info.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ box.info()
:return: keys and values in the submodule
:rtype: table

Since version :doc:`3.3.0 </release/3.3.0>` returns the ``hierarchy`` table, showing names of the group, replicaset, and the instance itself.
These names are taken directly from the ``--name`` CLI option (or the ``TT_INSTANCE_NAME`` environment variable)
and the cluster configuration. This means they are always present if the YAML configuration flow is in use,
disregarding the database status (whether upgraded, writable or not).

**Example**

This example is for a master-replica set that contains one master instance
Expand Down Expand Up @@ -94,4 +99,8 @@ box.info()
last: &0 []
active: *0
alerts: []
hierarchy:
group: storages
replicaset: storage-a
instance: storage-a-002
...
23 changes: 23 additions & 0 deletions doc/reference/reference_lua/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,13 @@ config API

- ``alerts`` -- warnings or errors raised on an attempt to apply the configuration

Since version :doc:`3.3.0 </release/3.3.0>`

- ``hierarchy`` -- table, showing names of the group, replicaset, and the instance itself.
These names are taken directly from the ``--name`` CLI option (or the ``TT_INSTANCE_NAME`` environment variable)
and the cluster configuration. This means they are always present if the YAML configuration flow is in use,
disregarding the database status (whether upgraded, writable or not).

Below are a few examples demonstrating how the ``info()`` output might look.

**Example: no configuration warnings or errors**
Expand All @@ -174,6 +181,10 @@ config API
last: &0 []
active: *0
alerts: []
hierarchy:
group: group-001
replicaset: replicaset-001
instance: instance-001
...

**Example: configuration warnings**
Expand All @@ -196,6 +207,10 @@ config API
upgrade has not been performed, or the privilege write has failed (separate
alert reported)
timestamp: 2024-07-03T18:09:18.826138+0300
hierarchy:
group: group-001
replicaset: replicaset-001
instance: instance-001
...

This warning is cleared when the ``bands`` space is created.
Expand All @@ -219,6 +234,10 @@ config API
allowed: 0, fatal, 1, syserror, 2, error, 3, crit, 4, warn, 5, info, 6, verbose,
7, debug'
timestamp: 2024-07-03T18:13:19.755454+0300
hierarchy:
group: group-001
replicaset: replicaset-001
instance: instance-001
...

**Example: configuration errors (centralized configuration storage)**
Expand Down Expand Up @@ -248,6 +267,10 @@ config API
8, but only the following values are allowed: 0, fatal, 1, syserror, 2, error,
3, crit, 4, warn, 5, info, 6, verbose, 7, debug'
timestamp: 2024-07-03T15:22:06.438275Z
hierarchy:
group: group001
replicaset: replicaset001
instance: instance001
...


Expand Down