From 4d05ae395ecb6b517d461a3bb9fa31e782ea8154 Mon Sep 17 00:00:00 2001 From: Pavel Semyonov Date: Tue, 8 Oct 2024 12:35:00 +0700 Subject: [PATCH 1/3] Add compat.box_info_cluster_meaning --- .../configuration/configuration_reference.rst | 2 + .../reference_lua/box_info/cluster.rst | 2 +- doc/reference/reference_lua/compat.rst | 1 + .../compat/box_info_cluster_meaning.rst | 72 +++++++++++++++++++ 4 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 doc/reference/reference_lua/compat/box_info_cluster_meaning.rst diff --git a/doc/reference/configuration/configuration_reference.rst b/doc/reference/configuration/configuration_reference.rst index 7f7963a28..c467512b4 100644 --- a/doc/reference/configuration/configuration_reference.rst +++ b/doc/reference/configuration/configuration_reference.rst @@ -505,6 +505,8 @@ The ``compat`` section defines values of the :ref:`compat ` 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' diff --git a/doc/reference/reference_lua/box_info/cluster.rst b/doc/reference/reference_lua/box_info/cluster.rst index 231d398de..18075b9ff 100644 --- a/doc/reference/reference_lua/box_info/cluster.rst +++ b/doc/reference/reference_lua/box_info/cluster.rst @@ -13,6 +13,6 @@ box.info.cluster * ``name`` -- the cluster name - See also: :ref:`compat.box_info_cluster_meaning ` + See also: :ref:`compat.box_info_cluster_meaning ` :rtype: table diff --git a/doc/reference/reference_lua/compat.rst b/doc/reference/reference_lua/compat.rst index 2b5b70009..0f9999acb 100644 --- a/doc/reference/reference_lua/compat.rst +++ b/doc/reference/reference_lua/compat.rst @@ -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: diff --git a/doc/reference/reference_lua/compat/box_info_cluster_meaning.rst b/doc/reference/reference_lua/compat/box_info_cluster_meaning.rst new file mode 100644 index 000000000..ecdc9c6da --- /dev/null +++ b/doc/reference/reference_lua/compat/box_info_cluster_meaning.rst @@ -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. + +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 + --- + - + ... + + tarantool> box.info.replicaset + --- + - uuid: + - <... other attributes of the replicaset> + ... + +.. 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: + - <... other attributes of the replicaset> + ... + + tarantool> box.info.replicaset (= nil on < 3.0.0) + --- + - uuid: + - <... other attributes of the replicaset> + ... + +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``. \ No newline at end of file From 87af27a6be8e7bef731abbfb9a3518a0d0991346 Mon Sep 17 00:00:00 2001 From: Pavel Semyonov Date: Tue, 8 Oct 2024 12:46:14 +0700 Subject: [PATCH 2/3] Add compat.box_info_cluster_meaning --- doc/reference/reference_lua/compat/box_info_cluster_meaning.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/reference/reference_lua/compat/box_info_cluster_meaning.rst b/doc/reference/reference_lua/compat/box_info_cluster_meaning.rst index ecdc9c6da..337492e33 100644 --- a/doc/reference/reference_lua/compat/box_info_cluster_meaning.rst +++ b/doc/reference/reference_lua/compat/box_info_cluster_meaning.rst @@ -51,7 +51,7 @@ Old behavior: ``box.info.cluster`` displays information about the current replic - <... other attributes of the replicaset> ... - tarantool> box.info.replicaset (= nil on < 3.0.0) + tarantool> box.info.replicaset --- - uuid: - <... other attributes of the replicaset> From 47222006632eb251be096d00ce78238adc05d13c Mon Sep 17 00:00:00 2001 From: Pavel Semyonov Date: Tue, 8 Oct 2024 19:23:13 +0700 Subject: [PATCH 3/3] Update box_info_cluster_meaning.rst --- .../compat/box_info_cluster_meaning.rst | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/doc/reference/reference_lua/compat/box_info_cluster_meaning.rst b/doc/reference/reference_lua/compat/box_info_cluster_meaning.rst index 337492e33..03a67596e 100644 --- a/doc/reference/reference_lua/compat/box_info_cluster_meaning.rst +++ b/doc/reference/reference_lua/compat/box_info_cluster_meaning.rst @@ -7,8 +7,9 @@ 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. +information. The ``box_info_cluster_meaning`` compat option in Tarantool 3.0 or later +allows to rollback to the old meaning of ``box.info.cluster`` - display information +about a single replica set. Old and new behavior -------------------- @@ -24,13 +25,13 @@ cluster with all its replica sets. tarantool> box.info.cluster --- - - + - name: my_cluster ... tarantool> box.info.replicaset --- - - uuid: - - <... other attributes of the replicaset> + - uuid: 0a3ff0c7-9075-441c-b0f5-b93a24be07cb + name: router-001 ... .. note:: @@ -47,14 +48,14 @@ Old behavior: ``box.info.cluster`` displays information about the current replic tarantool> box.info.cluster --- - - uuid: - - <... other attributes of the replicaset> + - uuid: 0a3ff0c7-9075-441c-b0f5-b93a24be07cb + name: router-001 ... tarantool> box.info.replicaset --- - - uuid: - - <... other attributes of the replicaset> + - uuid: 0a3ff0c7-9075-441c-b0f5-b93a24be07cb + name: router-001 ... Known compatibility issues @@ -69,4 +70,4 @@ 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``. \ No newline at end of file +replace the ``cluster`` key with ``replicaset``.