Skip to content
Snippets Groups Projects
Commit d79e7a3c authored by Georgiy Lebedev's avatar Georgiy Lebedev Committed by Aleksandr Lyapunov
Browse files

box: support tuple formats in IPROTO `call` and `eval` request arguments

Since tuple format cannot be created in IPROTO thread, we only save the
tuple format data and later create a tuple format map from it when
processing `call` and `eval` requests.

Closes #8633

@TarantoolBot document
Title: Tuple formats in IPROTO

New MsgPack extension was added, `MP_TUPLE`, which is used exclusively
in IPROTO. It has the following structure:
+----------+-----------------+----------+
|MP_EXT = 7|      MP_UINT    | MP_ARRAY |
+----------+-----------------+----------+
            ^                 ^
            format identifier tuple data

New IPROTO features were added:
* `IPROTO_FEATURE_DML_TUPLE_EXTENSION = 7` — tuples in `IPROTO_DATA` are
   encoded as `MP_TUPLE` and tuple format is sent in response to DML
   requests.
* `IPROTO_FEATURE_CALL_RET_TUPLE_EXTENSION = 8` —tuples in `IPROTO_DATA`
  are encoded as `MP_TUPLE` and tuple format is sent in response to `call`
  and `eval` requests.
* `IPROTO_FEATURE_CALL_ARG_TUPLE_EXTENSION = 9` — tuples in `IPROTO_TUPLE`
  of `call` and `eval` requests are encoded as `MP_TUPLE` with their
  formats encoded as described below.

The `IPROTO_FEATURE_DML_TUPLE_EXTENSION` feature can be enabled in
`net.box` by setting the `fetch_schema` option to `false` when creating a
new connection.

A new IPROTO key for bodies of responses with data and bodies of `call` and
`eval` requests: `IPROTO_TUPLE_FORMATS = 0x60` — a `MP_MAP` consisting of
`MP_UINT` keys (format identifiers) and `MP_STRING` values (tuple format
clauses).

A new backward compatibility option was added (and a new page,
`https://tarantool.io/compat/box_tuple_extension`, needs to be created for
it): `BOX_TUPLE_EXTENSION_BRIEF` — it controls the
`IPROTO_FEATURE_CALL_RET_TUPLE_EXTENSION` and
`IPROTO_FEATURE_CALL_ARG_TUPLE_EXTENSION` feature bits. It was added for
clients that assume to receive `MP_ARRAY`s in `call` and `eval` requests
arguments and response data.

Please refer to the design document for [details](https://www.notion.so/tarantool/Schemafull-IPROTO-cc315ad6bdd641dea66ad854992d8cbf?pvs=4#7d86000c69cb4f8087a289f2caad73a0).
parent 4d66f1eb
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment