From c23214e1c4bd75428e4cc1ffe28fa09f3340fbad Mon Sep 17 00:00:00 2001 From: "a.ardeev" Date: Tue, 3 Jun 2025 14:14:36 +0300 Subject: [PATCH 1/4] Adds hierarchy table description Since 3.3.0 the ``hierarchy`` table shows names of the group, replicaset, and the instance itself Table is reported in ``config:info()``; ``config:info('v2')``; ``box.info.config`` Fixes 4608 --- .../reference_lua/box_info/config.rst | 7 +++++++ doc/reference/reference_lua/box_info/info.rst | 7 +++++++ doc/reference/reference_lua/config.rst | 20 +++++++++++++++++++ 3 files changed, 34 insertions(+) diff --git a/doc/reference/reference_lua/box_info/config.rst b/doc/reference/reference_lua/box_info/config.rst index 0fb2df7f2..97d73f39f 100644 --- a/doc/reference/reference_lua/box_info/config.rst +++ b/doc/reference/reference_lua/box_info/config.rst @@ -13,6 +13,9 @@ 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') `. + Since version :doc:`3.3.0 ` + Returns the ``hierarchy`` table, showing names of the group, replicaset, and the instance itself. + :rtype: table **Example** @@ -26,4 +29,8 @@ box.info.config last: &0 [] active: *0 alerts: [] + hierarchy: + group: group-001 + replicaset: replicaset-001 + instance: instance-001 ... diff --git a/doc/reference/reference_lua/box_info/info.rst b/doc/reference/reference_lua/box_info/info.rst index 48d5e882a..ee2d44920 100644 --- a/doc/reference/reference_lua/box_info/info.rst +++ b/doc/reference/reference_lua/box_info/info.rst @@ -17,6 +17,9 @@ box.info() :return: keys and values in the submodule :rtype: table + Since version :doc:`3.3.0 ` + Returns the ``hierarchy`` table, showing names of the group, replicaset, and the instance itself. + **Example** This example is for a master-replica set that contains one master instance @@ -94,4 +97,8 @@ box.info() last: &0 [] active: *0 alerts: [] + hierarchy: + group: group-001 + replicaset: replicaset-001 + instance: instance-001 ... diff --git a/doc/reference/reference_lua/config.rst b/doc/reference/reference_lua/config.rst index 6039e9c0c..ae4e8dbc7 100644 --- a/doc/reference/reference_lua/config.rst +++ b/doc/reference/reference_lua/config.rst @@ -159,6 +159,10 @@ config API - ``alerts`` -- warnings or errors raised on an attempt to apply the configuration + Since version :doc:`3.3.0 ` + + - ``hierarchy`` -- table, showing names of the group, replicaset, and the instance itself. + Below are a few examples demonstrating how the ``info()`` output might look. **Example: no configuration warnings or errors** @@ -174,6 +178,10 @@ config API last: &0 [] active: *0 alerts: [] + hierarchy: + group: group-001 + replicaset: replicaset-001 + instance: instance-001 ... **Example: configuration warnings** @@ -196,6 +204,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. @@ -219,6 +231,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)** @@ -248,6 +264,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: group-001 + replicaset: replicaset-001 + instance: instance-001 ... From e8b681db777e1bdc13e326c0fd7ec0b9f9fdac04 Mon Sep 17 00:00:00 2001 From: "a.ardeev" Date: Wed, 4 Jun 2025 12:56:32 +0300 Subject: [PATCH 2/4] Updates by comments --- doc/reference/reference_lua/box_info/config.rst | 9 ++++++--- doc/reference/reference_lua/box_info/info.rst | 9 ++++++--- doc/reference/reference_lua/config.rst | 11 +++++++---- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/doc/reference/reference_lua/box_info/config.rst b/doc/reference/reference_lua/box_info/config.rst index 97d73f39f..6dd0d3abb 100644 --- a/doc/reference/reference_lua/box_info/config.rst +++ b/doc/reference/reference_lua/box_info/config.rst @@ -15,6 +15,9 @@ box.info.config Since version :doc:`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 @@ -30,7 +33,7 @@ box.info.config active: *0 alerts: [] hierarchy: - group: group-001 - replicaset: replicaset-001 - instance: instance-001 + group: storages + replicaset: storage-a + instance: storage-a-002 ... diff --git a/doc/reference/reference_lua/box_info/info.rst b/doc/reference/reference_lua/box_info/info.rst index ee2d44920..8a4f251f7 100644 --- a/doc/reference/reference_lua/box_info/info.rst +++ b/doc/reference/reference_lua/box_info/info.rst @@ -19,6 +19,9 @@ box.info() Since version :doc:`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** @@ -98,7 +101,7 @@ box.info() active: *0 alerts: [] hierarchy: - group: group-001 - replicaset: replicaset-001 - instance: instance-001 + group: storages + replicaset: storage-a + instance: storage-a-002 ... diff --git a/doc/reference/reference_lua/config.rst b/doc/reference/reference_lua/config.rst index ae4e8dbc7..5a3ff135f 100644 --- a/doc/reference/reference_lua/config.rst +++ b/doc/reference/reference_lua/config.rst @@ -161,7 +161,10 @@ config API Since version :doc:`3.3.0 ` - - ``hierarchy`` -- table, showing names of the group, replicaset, and the instance itself. + - ``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. @@ -265,9 +268,9 @@ config API 3, crit, 4, warn, 5, info, 6, verbose, 7, debug' timestamp: 2024-07-03T15:22:06.438275Z hierarchy: - group: group-001 - replicaset: replicaset-001 - instance: instance-001 + group: group001 + replicaset: replicaset001 + instance: instance001 ... From dfaacf72cb9be4a73ff7eeda1655a20289b11af4 Mon Sep 17 00:00:00 2001 From: "a.ardeev" Date: Wed, 4 Jun 2025 13:10:40 +0300 Subject: [PATCH 3/4] Fixes syntax --- doc/reference/reference_lua/box_info/config.rst | 2 +- doc/reference/reference_lua/box_info/info.rst | 2 +- doc/reference/reference_lua/config.rst | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/reference/reference_lua/box_info/config.rst b/doc/reference/reference_lua/box_info/config.rst index 6dd0d3abb..a1ece9eaa 100644 --- a/doc/reference/reference_lua/box_info/config.rst +++ b/doc/reference/reference_lua/box_info/config.rst @@ -13,7 +13,7 @@ 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') `. - Since version :doc:`3.3.0 ` + Since version :doc:`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, diff --git a/doc/reference/reference_lua/box_info/info.rst b/doc/reference/reference_lua/box_info/info.rst index 8a4f251f7..9e255ffd3 100644 --- a/doc/reference/reference_lua/box_info/info.rst +++ b/doc/reference/reference_lua/box_info/info.rst @@ -17,7 +17,7 @@ box.info() :return: keys and values in the submodule :rtype: table - Since version :doc:`3.3.0 ` + Since version :doc:`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, diff --git a/doc/reference/reference_lua/config.rst b/doc/reference/reference_lua/config.rst index 5a3ff135f..e96b7f064 100644 --- a/doc/reference/reference_lua/config.rst +++ b/doc/reference/reference_lua/config.rst @@ -161,7 +161,7 @@ config API Since version :doc:`3.3.0 ` - - ``hierarchy`` -- table, showing names of the group, replicaset, and the instance itself. + - ``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). From 41b09d8a17df521739856adab53ca4421f6dd4c4 Mon Sep 17 00:00:00 2001 From: "a.ardeev" Date: Wed, 4 Jun 2025 13:22:06 +0300 Subject: [PATCH 4/4] fixes syntax --- doc/reference/reference_lua/box_info/config.rst | 3 +-- doc/reference/reference_lua/box_info/info.rst | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/doc/reference/reference_lua/box_info/config.rst b/doc/reference/reference_lua/box_info/config.rst index a1ece9eaa..37b8efab3 100644 --- a/doc/reference/reference_lua/box_info/config.rst +++ b/doc/reference/reference_lua/box_info/config.rst @@ -13,8 +13,7 @@ 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') `. - Since version :doc:`3.3.0 `. - Returns the ``hierarchy`` table, showing names of the group, replicaset, and the instance itself. + Since version :doc:`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). diff --git a/doc/reference/reference_lua/box_info/info.rst b/doc/reference/reference_lua/box_info/info.rst index 9e255ffd3..134e34af9 100644 --- a/doc/reference/reference_lua/box_info/info.rst +++ b/doc/reference/reference_lua/box_info/info.rst @@ -17,8 +17,7 @@ box.info() :return: keys and values in the submodule :rtype: table - Since version :doc:`3.3.0 `. - Returns the ``hierarchy`` table, showing names of the group, replicaset, and the instance itself. + Since version :doc:`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).