Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 2 additions & 0 deletions doc/reference/configuration/configuration_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,8 @@ The ``compat`` section defines values of the :ref:`compat <compat-module>` modul
- ``new``: show the entire cluster
- ``old:``: show the current replica set

See also: :ref:`compat-option-box-info-cluster`

|
| Type: string
| Possible values: 'new', 'old'
Expand Down
2 changes: 1 addition & 1 deletion doc/reference/reference_lua/box_info/cluster.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ box.info.cluster

* ``name`` -- the cluster name

See also: :ref:`compat.box_info_cluster_meaning <configuration_reference_compat_cluster_meaning>`
See also: :ref:`compat.box_info_cluster_meaning <compat-option-box-info-cluster>`

:rtype: table
1 change: 1 addition & 0 deletions doc/reference/reference_lua/compat.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ Below are the available ``compat`` options:
* :doc:`sql_seq_scan_default <./compat/sql_seq_scan_default>`
* :doc:`fiber_slice_default <./compat/fiber_slice_default>`
* :doc:`binary_data_decoding <./compat/binary_data_decoding>`
* :doc:`box_info_cluster_meaning <./compat/box_info_cluster_meaning>`

.. toctree::
:hidden:
Expand Down
72 changes: 72 additions & 0 deletions doc/reference/reference_lua/compat/box_info_cluster_meaning.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
.. _compat-option-box-info-cluster:

Meaning of box.info.cluster
===========================

Option: ``box_info_cluster_meaning``

Starting from version 3.0, the :ref:`box_info_cluster` table stores the information
about the entire cluster. In earlier versions, it stored only the current replica set
information. The ``box_info_cluster_meaning`` compat option allows to define the
the scope of ``box.info.cluster``: the entire cluster or a single replica set.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add something that makes it clear that the new behavior is 3.0.0's default?

After reading this paragraph I was in a doubt: whether it is 3.0.0's behavior that can be enabled using the compat option or it is a default in this version.


Old and new behavior
--------------------

New behavior: ``box.info.cluster`` displays information about the entire
cluster with all its replica sets.

.. code-block:: tarantoolsession

tarantool> compat.box_info_cluster_meaning = 'new'
---
...

tarantool> box.info.cluster
---
- <cluster information>
...

tarantool> box.info.replicaset
---
- uuid: <replicaset uuid>
- <... other attributes of the replicaset>
...
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be convenient to have an example of a real output (preferably with persistent names set).

We say 'entire cluster information' and 'replicaset information' above, but it is very abstract. As a user I can expect a list of instances, their metrics, configuration and so on.

In fact, we have box.info.replicaset.{uuid,name} and box.info.cluster.name. That's all the fields.


.. note::

In the new behavior, :ref:`box_info_replicaset` is equivalent to the old ``box.info.cluster``.

Old behavior: ``box.info.cluster`` displays information about the current replica set.

.. code-block:: tarantoolsession

tarantool> compat.box_info_cluster_meaning = 'old'
---
...

tarantool> box.info.cluster
---
- uuid: <replicaset uuid>
- <... other attributes of the replicaset>
...

tarantool> box.info.replicaset
---
- uuid: <replicaset uuid>
- <... other attributes of the replicaset>
...
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.


Known compatibility issues
--------------------------

``vshard`` versions earlier than 0.1.24 do not support the new behavior.


Detecting issues in your codebase
---------------------------------

Look for all usages of ``box.info.cluster``, ``info.cluster``, and
``.cluster``, ``['cluster']``, ``["cluster"]`` in the application code
written before the change. To make it work the same way on Tarantool 3.0 or later,
replace the ``cluster`` key with ``replicaset``.
Loading