Skip to content

Commit 4d05ae3

Browse files
committed
Add compat.box_info_cluster_meaning
1 parent 344ba58 commit 4d05ae3

File tree

4 files changed

+76
-1
lines changed

4 files changed

+76
-1
lines changed

doc/reference/configuration/configuration_reference.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,8 @@ The ``compat`` section defines values of the :ref:`compat <compat-module>` modul
505505
- ``new``: show the entire cluster
506506
- ``old:``: show the current replica set
507507

508+
See also: :ref:`compat-option-box-info-cluster`
509+
508510
|
509511
| Type: string
510512
| Possible values: 'new', 'old'

doc/reference/reference_lua/box_info/cluster.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ box.info.cluster
1313

1414
* ``name`` -- the cluster name
1515

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

1818
:rtype: table

doc/reference/reference_lua/compat.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ Below are the available ``compat`` options:
7373
* :doc:`sql_seq_scan_default <./compat/sql_seq_scan_default>`
7474
* :doc:`fiber_slice_default <./compat/fiber_slice_default>`
7575
* :doc:`binary_data_decoding <./compat/binary_data_decoding>`
76+
* :doc:`box_info_cluster_meaning <./compat/box_info_cluster_meaning>`
7677

7778
.. toctree::
7879
:hidden:
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
.. _compat-option-box-info-cluster:
2+
3+
Meaning of box.info.cluster
4+
===========================
5+
6+
Option: ``box_info_cluster_meaning``
7+
8+
Starting from version 3.0, the :ref:`box_info_cluster` table stores the information
9+
about the entire cluster. In earlier versions, it stored only the current replica set
10+
information. The ``box_info_cluster_meaning`` compat option allows to define the
11+
the scope of ``box.info.cluster``: the entire cluster or a single replica set.
12+
13+
Old and new behavior
14+
--------------------
15+
16+
New behavior: ``box.info.cluster`` displays information about the entire
17+
cluster with all its replica sets.
18+
19+
.. code-block:: tarantoolsession
20+
21+
tarantool> compat.box_info_cluster_meaning = 'new'
22+
---
23+
...
24+
25+
tarantool> box.info.cluster
26+
---
27+
- <cluster information>
28+
...
29+
30+
tarantool> box.info.replicaset
31+
---
32+
- uuid: <replicaset uuid>
33+
- <... other attributes of the replicaset>
34+
...
35+
36+
.. note::
37+
38+
In the new behavior, :ref:`box_info_replicaset` is equivalent to the old ``box.info.cluster``.
39+
40+
Old behavior: ``box.info.cluster`` displays information about the current replica set.
41+
42+
.. code-block:: tarantoolsession
43+
44+
tarantool> compat.box_info_cluster_meaning = 'old'
45+
---
46+
...
47+
48+
tarantool> box.info.cluster
49+
---
50+
- uuid: <replicaset uuid>
51+
- <... other attributes of the replicaset>
52+
...
53+
54+
tarantool> box.info.replicaset (= nil on < 3.0.0)
55+
---
56+
- uuid: <replicaset uuid>
57+
- <... other attributes of the replicaset>
58+
...
59+
60+
Known compatibility issues
61+
--------------------------
62+
63+
``vshard`` versions earlier than 0.1.24 do not support the new behavior.
64+
65+
66+
Detecting issues in your codebase
67+
---------------------------------
68+
69+
Look for all usages of ``box.info.cluster``, ``info.cluster``, and
70+
``.cluster``, ``['cluster']``, ``["cluster"]`` in the application code
71+
written before the change. To make it work the same way on Tarantool 3.0 or later,
72+
replace the ``cluster`` key with ``replicaset``.

0 commit comments

Comments
 (0)