Skip to content

Adds warnings on replication related issues #5285

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

Open
wants to merge 2 commits into
base: latest
Choose a base branch
from
Open
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
56 changes: 56 additions & 0 deletions doc/reference/reference_lua/box_space.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,62 @@ It has the data-manipulation functions ``select``, ``insert``, ``replace``,
``update``, ``upsert``, ``delete``, ``get``, ``put``. It also has members,
such as id, and whether or not a space is enabled.

.. WARNING::

Option 1 global Warning:
The following operations involve full space traversal:

- :doc:`./box_space/create_index`;
- :doc:`./box_space/alter`;
- :doc:`./box_space/format`.

Full traversal is the process of processing every node or element in the space structure exactly once
in a systematic manner. Full traversal may leadThese operations introduce replication lag for both
synchronous and asynchronous replication and make writes with synchronous replication unavailable
for the whole duration of operation when initiated at the following conditions:

- initiated on a space with over 10000 tuples AND
- when the node is under any load (when it processes user requests/performs business operations).

To avoid issues:

- initiate named operations on spaces that do not exceed 10000 tuples OR
- initiate named operations when the node is not under any load;
- instead of the ``space_object:format()`` operation, perform the :ref:`box_space-upgrade` operation.

Safe exceptions for named operations are:

- changing indexed field type to a more generic one («unsigned» to «number», «decimal» to «scalar»);
- turning a unique index into a non-unique one;
- changing some of the index parameters which do not require a rebuild (changing page_size of a vinyl space index).
- changing space format to a more generic one.

Option 2 global Warning:
The following operations involve full space traversal and introduce replication lag for both synchronous
and asynchronous replication and make writes with synchronous replication unavailable for the whole duration
of operation when initiated at certain conditions:

- :doc:`./box_space/create_index`;
- :doc:`./box_space/alter`;
- :doc:`./box_space/format`.

The issues occur when the operations are initiated at the following conditions:

- initiated on a space with over 10000 tuples AND
- when the node is under any load (when it processes user requests/performs business operations).

To avoid issues:

- initiate named operations on spaces that do not exceed 10000 tuples OR
- initiate named operations when the node is not under any load;
- instead of the ``space_object:format()`` operation, perform the :ref:`box_space-upgrade` operation.

Safe exceptions for named operations are:
- changing indexed field type to a more generic one («unsigned» to «number», «decimal» to «scalar»);
- turning a unique index into a non-unique one;
- changing some of the index parameters which do not require a rebuild (changing page_size of a vinyl space index).
- changing space format to a more generic one.

Below is a list of all ``box.space`` functions and members.

.. container:: table
Expand Down
52 changes: 52 additions & 0 deletions doc/reference/reference_lua/box_space/alter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,58 @@ space_object:alter()
Since version :doc:`2.5.2 </release/2.5.2>`.
Alter an existing space. This method changes certain space parameters.

.. WARNING::

Option 1 alter Warning:

The ``space_object:alter()`` operation involves full space traversal. Full traversal
is the process of processing every node or element in the space structure exactly once
in a systematic manner.

Full traversal may lead to replication lag for both synchronous and asynchronous replication
and make writes with synchronous replication unavailable for the whole duration of operation
when initiated at the following conditions:

- initiated on a space with over 10000 tuples AND
- when the node is under any load (when it processes user requests/performs business operations).

To avoid issues:

- initiate the ``space_object:alter()`` operation on spaces that do not exceed 10000 tuples OR
- initiate the ``space_object:alter()`` operation when the node is not under any load.

Safe exceptions for the ``space_object:alter()`` operation are:

- changing indexed field type to a more generic one («unsigned» to «number», «decimal» to «scalar»);
- turning a unique index into a non-unique one;
- changing some of the index parameters which do not require a rebuild (changing page_size of a vinyl space index).

In future releases, the ``space_object:alter()`` operation will be deprecated.

Option 2 alter Warning:

The ``space_object:alter()`` operation involve full space traversal and introduce replication lag for both
synchronous and asynchronous replication and make writes with synchronous replication unavailable for the
whole duration of operation when initiated at certain conditions.

The issues occur when the ``space_object:alter()`` operation is initiated at the following conditions:

- initiated on a space with over 10000 tuples AND
- when the node is under any load (when it processes user requests/performs business operations).

To avoid issues:

- initiate the ``space_object:alter()`` operation on spaces that do not exceed 10000 tuples OR
- initiate the ``space_object:alter()`` operation when the node is not under any load.

Safe exceptions for the ``space_object:alter()`` operation are:

- changing indexed field type to a more generic one («unsigned» to «number», «decimal» to «scalar»);
- turning a unique index into a non-unique one;
- changing some of the index parameters which do not require a rebuild (changing page_size of a vinyl space index).

In future releases, the ``space_object:alter()`` operation will be deprecated.

:param table options: the space options such as ``field_count``, ``user``,
``format``, ``name``, and other. The full list of
these options with descriptions parameters is provided in
Expand Down
37 changes: 37 additions & 0 deletions doc/reference/reference_lua/box_space/create_index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,43 @@ space_object:create_index()
tuples into it or select tuples from it. The first created index
will be used as the primary-key index, so it must be unique.

.. WARNING::

Option 1 create Warning:

The ``space_object:create_index()`` operation involves full space traversal. Full traversal
is the process of processing every node or element in the space structure exactly once
in a systematic manner.

Full traversal may lead to replication lag for both synchronous and asynchronous replication
and make writes with synchronous replication unavailable for the whole duration of operation
when initiated at the following conditions:

- initiated on a space with over 10000 tuples AND
- when the node is under any load (when it processes user requests/performs business operations).

To avoid issues:

- initiate the ``space_object:create_index()`` operation on spaces that do not exceed 10000 tuples OR
- initiate the ``space_object:create_index()`` operation when the node is not under any load.

Option 2 create Warning:

The ``space_object:create_index()`` operation involve full space traversal and introduce replication lag for both
synchronous and asynchronous replication and make writes with synchronous replication unavailable for the
whole duration of operation when initiated at certain conditions.

The issues occur when the ``space_object:create_index()`` operation is initiated at the following conditions:

- initiated on a space with over 10000 tuples AND
- when the node is under any load (when it processes user requests/performs business operations).

To avoid issues:

- initiate the ``space_object:create_index()`` operation on spaces that do not exceed 10000 tuples OR
- initiate the ``space_object:create_index()`` operation when the node is not under any load.


:param space_object space_object: an :ref:`object reference
<app_server-object_reference>`
:param string index_name: name of index, which should conform to the
Expand Down
46 changes: 46 additions & 0 deletions doc/reference/reference_lua/box_space/format.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,52 @@ space_object:format()

Declare field names and :ref:`types <index-box_data-types>`.

.. WARNING::

Option 1 format Warning:

The ``space_object:format()`` operation involves full space traversal. Full traversal
is the process of processing every node or element in the space structure exactly once
in a systematic manner.

Full traversal may lead to replication lag for both synchronous and asynchronous replication
and make writes with synchronous replication unavailable for the whole duration of operation
when initiated at the following conditions:

- initiated on a space with over 10000 tuples AND
- when the node is under any load (when it processes user requests/performs business operations).

To avoid issues:

- initiate the ``space_object:format()`` operation on spaces that do not exceed 10000 tuples OR
- initiate the ``space_object:format()`` operation when the node is not under any load;
- instead of the ``space_object:format()`` operation, perform the :ref:`box_space-upgrade` operation.

Safe exception for the ``space_object:format()`` operation is:

- changing space format to a more generic one.

Option 2 format Warning:

The ``space_object:format()`` operation involve full space traversal and introduce replication lag for both
synchronous and asynchronous replication and make writes with synchronous replication unavailable for the
whole duration of operation when initiated at certain conditions.

The issues occur when the ``space_object:format()`` operation is initiated at the following conditions:

- initiated on a space with over 10000 tuples AND
- when the node is under any load (when it processes user requests/performs business operations).

To avoid issues:

- initiate the ``space_object:format()`` operation on spaces that do not exceed 10000 tuples OR
- initiate the ``space_object:format()`` operation when the node is not under any load;
- instead of the ``space_object:format()`` operation, perform the :ref:`box_space-upgrade` operation.

Safe exception for the ``space_object:format()`` operation is:

- changing space format to a more generic one.

:param space_object space_object: an :ref:`object reference
<app_server-object_reference>`
:param table format-clause: a list of field names and types
Expand Down