Skip to content

Commit 6e24105

Browse files
authored
Correct the Streams article (#2735)
Resolves #2503
1 parent 6834bc3 commit 6e24105

File tree

2 files changed

+23
-10
lines changed

2 files changed

+23
-10
lines changed

doc/book/box/stream.rst

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ a stream transfers data via the protocol between a client and a server.
2929

3030
.. _box_stream-features:
3131

32-
New features
33-
------------
32+
Features
33+
--------
3434

3535
The primary purpose of :term:`streams <stream>` is to execute transactions via iproto.
3636
Every stream has its own identifier, which is unique within the connection.
@@ -45,6 +45,10 @@ The ID is generated on the client side automatically.
4545
If a user writes their own connector and wants to use streams,
4646
they must transmit the ``stream_id`` over the iproto protocol.
4747

48+
Interactive transactions over streams only work if
49+
the ``box.cfg{}`` option :ref:`memtx_use_mvcc_engine <cfg_basic-memtx_use_mvcc_engine>`
50+
is enabled on the server: ``memtx_use_mvcc_engine = true``.
51+
4852
.. _box_stream-interaction:
4953

5054
Interaction between streams and transactions
@@ -63,7 +67,7 @@ that transaction will be rolled back if it hasn't been committed before the conn
6367

6468
Example:
6569

66-
.. code-block:: lua
70+
.. code-block:: lua
6771
6872
local conn = net_box.connect(remote_server_addr)
6973
local conn_space = conn.space.test
@@ -72,15 +76,15 @@ Example:
7276
7377
-- Begin transaction over an iproto stream:
7478
stream:begin()
75-
space:replace({1})
79+
stream_space:replace({1})
7680
7781
-- Empty select, the transaction was not committed.
7882
-- You can't see it from the requests that do not belong to the
7983
-- transaction.
84+
conn_space:select{}
8085
8186
-- Select returns the previously inserted tuple,
8287
-- because this select belongs to the transaction:
83-
conn_space:select{}
8488
stream_space:select({})
8589
8690
-- Commit transaction:

locale/ru/LC_MESSAGES/book/box/stream.po

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ msgstr ""
4646
"целиком в рамках одного запроса. ``begin``, ``commit`` и другие TX-"
4747
"инструкции могут быть отправлены и выполнены в разных запросах."
4848

49-
msgid "New features"
50-
msgstr "Новые функциональные возможности"
49+
msgid "Features"
50+
msgstr "Функциональные возможности"
5151

5252
msgid ""
5353
"The primary purpose of :term:`streams <stream>` is to execute transactions "
@@ -80,6 +80,15 @@ msgstr ""
8080
"поддержкой стримов. Используя стримы с пользовательским коннектором, "
8181
"необходимо передавать ``stream_id`` через протокол iproto."
8282

83+
msgid ""
84+
"Interactive transactions over streams only work if the ``box.cfg{}`` option "
85+
":ref:`memtx_use_mvcc_engine <cfg_basic-memtx_use_mvcc_engine>` is enabled on"
86+
" the server: ``memtx_use_mvcc_engine = true``."
87+
msgstr ""
88+
"Чтобы в стримах работали интерактивные транзакции, необходимо включить "
89+
"параметр ``box.cfg{}`` :ref:`memtx_use_mvcc_engine <cfg_basic-"
90+
"memtx_use_mvcc_engine>` на сервере: ``memtx_use_mvcc_engine = true``."
91+
8392
msgid "Interaction between streams and transactions"
8493
msgstr "Взаимодействие между стримами и транзакциями"
8594

@@ -122,15 +131,15 @@ msgid ""
122131
"\n"
123132
"-- Begin transaction over an iproto stream:\n"
124133
"stream:begin()\n"
125-
"space:replace({1})\n"
134+
"stream_space:replace({1})\n"
126135
"\n"
127136
"-- Empty select, the transaction was not committed.\n"
128137
"-- You can't see it from the requests that do not belong to the\n"
129138
"-- transaction.\n"
139+
"conn_space:select{}\n"
130140
"\n"
131141
"-- Select returns the previously inserted tuple,\n"
132142
"-- because this select belongs to the transaction:\n"
133-
"conn_space:select{}\n"
134143
"stream_space:select({})\n"
135144
"\n"
136145
"-- Commit transaction:\n"
@@ -146,7 +155,7 @@ msgstr ""
146155
"\n"
147156
"-- Начать транзакцию через поток iproto:\n"
148157
"stream:begin()\n"
149-
"space:replace({1})\n"
158+
"stream_space:replace({1})\n"
150159
"\n"
151160
"-- Пустой select, коммит транзакции не выполнен.\n"
152161
"-- Ее нельзя увидеть из запросов, не относящихся\n"

0 commit comments

Comments
 (0)