Skip to content

Commit cf37c5b

Browse files
committed
Fixes gh-2306 New field in binary iproto protocol, second commit
1 parent 6a9155a commit cf37c5b

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

doc/dev_guide/internals/box_protocol.rst

+12-8
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,9 @@ the client to check if it has changed.
277277

278278
**IPROTO_STREAM_ID** = 0x0a.
279279
An unsigned number that should be unique in every stream.
280-
In requests IPROTO_STREAM_ID is optional and is only useful for ensuring that requests within transactions are done in separate groups.
280+
In requests IPROTO_STREAM_ID is optional and is useful for two things:
281+
ensuring that requests within transactions are done in separate groups,
282+
and ensuring strictly consistent execution of requests (whether or not they are within transactions).
281283
In responses IPROTO_STREAM_ID does not appear.
282284
See :ref:`Binary protocol -- streams <box_protocol-streams>`.
283285

@@ -748,7 +750,7 @@ See the later section :ref:`Binary protocol -- streams <box_protocol-streams>`.
748750

749751
**IPROTO_COMMIT** = 0x0f.
750752

751-
This is for starting a transaction.
753+
This is for ending a transaction.
752754
Typically the header will include IPROTO_STREAM_ID.
753755
The body is: nothing.
754756
See the later section :ref:`Binary protocol -- streams <box_protocol-streams>`.
@@ -757,7 +759,7 @@ See the later section :ref:`Binary protocol -- streams <box_protocol-streams>`.
757759

758760
**IPROTO_ROLLBACK** = 0x10.
759761

760-
This is for starting a transaction.
762+
This is for ending a transaction.
761763
Typically the header will include IPROTO_STREAM_ID.
762764
The body is: nothing.
763765
See the later section :ref:`Binary protocol -- streams <box_protocol-streams>`.
@@ -1220,7 +1222,8 @@ function ``netbox_encode_auth``.
12201222
Binary protocol -- streams
12211223
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12221224

1223-
The streams feature, which was added in Tarantool version
1225+
The :ref:`Streams and interactive transactions <box_stream>`
1226+
feature, which was added in Tarantool version
12241227
:tarantool-release:`2.10.0-beta1`, allows two things:
12251228
sequential processing and interleaving.
12261229

@@ -1229,12 +1232,13 @@ With streams there is a guarantee that the server instance will not
12291232
handle the next request in a stream until it has completed the previous one.
12301233

12311234
Interleaving:
1232-
A series of requests can include
1233-
"insert for stream #1", "insert for stream #2", "delete for stream #2", "delete
1234-
for stream #1", and then a "commit for stream #1" which the server instance will
1235-
interpret as a request to handle only the two inserts for stream #1.
1235+
For example, a series of requests can include
1236+
"begin for stream #1", "begin for stream #2",
1237+
"insert for stream #1", "insert for stream #2", "delete
1238+
for stream #1", "commit for stream #1", "rollback for stream #2".
12361239

12371240
To make these things possible,
1241+
the engine should be :ref:`vinyl <engines-vinyl>` or :ref:`memtx with mvcc <cfg_basic-memtx_use_mvcc_engine>`, and
12381242
the client is responsible for ensuring that the stream identifier,
12391243
unsigned integer :ref:`IPROTO_STREAM_ID <box_protocol-iproto_stream_id>`, is in the request header.
12401244
IPROTO_STREAM_ID can be any positive 64-bit number, and should be unique for the connection.

0 commit comments

Comments
 (0)