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).
Showing
- changelogs/unreleased/gh-8633-tuple-formats-in-iproto-requests.md 6 additions, 0 deletions...gs/unreleased/gh-8633-tuple-formats-in-iproto-requests.md
- src/box/call.c 36 additions, 17 deletionssrc/box/call.c
- src/box/iproto_features.c 2 additions, 0 deletionssrc/box/iproto_features.c
- src/box/iproto_features.h 7 additions, 1 deletionsrc/box/iproto_features.h
- src/box/lua/net_box.c 43 additions, 11 deletionssrc/box/lua/net_box.c
- src/box/xrow.c 9 additions, 1 deletionsrc/box/xrow.c
- src/box/xrow.h 4 additions, 0 deletionssrc/box/xrow.h
- src/lua/compat.lua 2 additions, 1 deletionsrc/lua/compat.lua
- test/box-luatest/gh_7894_export_iproto_constants_and_features_test.lua 3 additions, 1 deletion...est/gh_7894_export_iproto_constants_and_features_test.lua
- test/box-luatest/gh_8633_tuple_formats_in_iproto_requests_test.lua 145 additions, 0 deletions...luatest/gh_8633_tuple_formats_in_iproto_requests_test.lua
- test/box-py/iproto.result 3 additions, 3 deletionstest/box-py/iproto.result
- test/box/net.box_iproto_id.result 8 additions, 3 deletionstest/box/net.box_iproto_id.result
Loading
Please register or sign in to comment