Skip to content

Change iproto and box.session.push re out-of-band #2700

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

Merged
merged 3 commits into from
May 17, 2022
Merged
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
10 changes: 10 additions & 0 deletions doc/dev_guide/internals/box_protocol.rst
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,13 @@ The IPROTO constants that appear within requests or responses that we will descr
IPROTO_FIELD_IS_NULLABLE=0x03
IPROTO_FIELD_IS_AUTOINCREMENT=0x04
IPROTO_FIELD_SPAN=0x05
IPROTO_CHUNK=0x80
IPROTO_RAFT_TERM=0x00
IPROTO_RAFT_VOTE=0x01
IPROTO_RAFT_STATE=0x02
IPROTO_RAFT_VCLOCK=0x03


To denote message descriptions we will say ``msgpack(...)`` and within it we will use modified
`YAML <https://en.wikipedia.org/wiki/YAML>`_ so: |br|

Expand Down Expand Up @@ -866,6 +868,14 @@ so if we were using net_box we could decode with
or we could convert to a string with :samp:`ffi.string({pointer},{length})`.
The :ref:`pickle.unpack() <pickle-unpack>` function might also be helpful.

.. _box_protocol-responses_out_of_band:

Responses for no error and out-of-band
--------------------------------------

If the response is out-of-band, due to use of
:ref:`box.session.push() <box_session-push>`,
then the header Response-Code-Indicator will be IPROTO_CHUNK instead of IPROTO_OK.

.. _box_protocol-responses_error:

Expand Down
5 changes: 3 additions & 2 deletions doc/reference/reference_lua/box_session/push.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ box.session.push()
* If the result is not an error, then the return is the boolean value ``true``.
* When the return is ``true``, the message has gone to the network
buffer as a :ref:`packet <box_protocol-iproto_protocol>`
with the code IPROTO_CHUNK (0x80).
with a different :ref:`header code <box_protocol-responses_out_of_band>`
so the client can distinguish from an ordinary Okay response.

The server's sole job is to call ``box.session.push()``, there is no
automatic mechanism for showing that the message was received.
Expand Down Expand Up @@ -139,4 +140,4 @@ box.session.push()
-- - *0
-- ...
-- Good. That shows that the message was asynchronous, and
-- that box.session.push() did its job.
-- that box.session.push() did its job.
10 changes: 10 additions & 0 deletions locale/ru/LC_MESSAGES/dev_guide/internals/box_protocol.po
Original file line number Diff line number Diff line change
Expand Up @@ -1548,6 +1548,16 @@ msgstr ""
":samp:`ffi.string({pointer},{length})`. Также здесь можно использовать "
"функцию :ref:`pickle.unpack() <pickle-unpack>`."

msgid "Responses for no error and out-of-band"
msgstr "Ответы на внеполосные сообщения"

msgid "If the response is out-of-band, due to use of"
" :ref:`box.session.push() <box_session-push>`,"
" then the header Response-Code-Indicator will be IPROTO_CHUNK instead of IPROTO_OK."
msgstr "Если используется :ref:`box.session.push() <box_session-push>`,"
" значением заголовка Response-Code-Indicator для внеполосных сообщений "
"будет IPROTO_CHUNK, а не IPROTO_OK."

msgid ""
"For a response other than IPROTO_OK, the header Response-Code-Indicator will"
" be ``0x8XXX`` and the body will be a 1-item map."
Expand Down
16 changes: 12 additions & 4 deletions locale/ru/LC_MESSAGES/reference/reference_lua/box_session/push.po
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ msgid ""
"Tarantool version :doc:`2.4.2 </release/2.4.2>`, ``sync`` is **deprecated** "
"and its use will cause a warning. Since version 2.5.1, its use will cause an"
" error."
msgstr ""
msgstr "необязательный аргумент, указывающий на сессию. Этот аргумент "
"берётся из предшествующего вызова :doc:`/reference/reference_lua/box_session/sync`."
" Если аргумент опущен, применяется значение по умолчанию --- "
"текущее значение ``box.session.sync()``. Аргумент признан устаревшим "
"в версии Tarantool :doc:`2.4.2 </release/2.4.2>`, а начиная с версии 2.5.1 "
"его использование приводит к ошибке."

msgid "rtype"
msgstr "тип возвращаемого значения"
Expand All @@ -58,11 +63,14 @@ msgstr ""

msgid ""
"When the return is ``true``, the message has gone to the network buffer as a"
" :ref:`packet <box_protocol-iproto_protocol>` with the code IPROTO_CHUNK "
"(0x80)."
" :ref:`packet <box_protocol-iproto_protocol>` "
"with a different :ref:`header code <box_protocol-responses_out_of_band>` "
"so the client can distinguish from an ordinary Okay response."
msgstr ""
"Если возвращается ``true``, сообщение отправлено в буфер сети в виде "
":ref:`пакета <box_protocol-iproto_protocol>` с кодом IPROTO_CHUNK (0x80)."
":ref:`пакета <box_protocol-iproto_protocol>` "
"с другим :ref:`кодом заголовка <box_protocol-responses_out_of_band>`, "
"и клиент может отличить такой ответ от обычного подтверждения."

msgid ""
"The server's sole job is to call ``box.session.push()``, there is no "
Expand Down