[Tarantool-patches] [PATCH v3 6/8] net.box: add stream support to net.box

Vladimir Davydov vdavydov at tarantool.org
Wed Aug 11 15:09:10 MSK 2021


On Wed, Aug 11, 2021 at 11:56:56AM +0300, mechanik20051988 wrote:
> From: mechanik20051988 <mechanik20.05.1988 at gmail.com>
> 
> Add stream support to `net.box`. In "net.box", stream
> is an object over connection that has the same methods,
> but all requests from it sends with non-zero stream ID.
> Since there can be a lot of streams, we do not copy the
> spaces from the connection to the stream immediately when
> creating a stream, but do it only when we first access space.
> Also, when updating the schema, we update the spaces in lazy
> mode: each stream has it's own schema_version, when there is
> some access to stream space we compare stream schema_version
> and connection schema_version and if they are different update
> clear stream space cache and wrap space that is being accessed
> to stream cache.
> 
> Part of #5860
> 
> @TarantoolBot document
> Title: stream support was added to net.box
> In "net.box", stream is an object over connection that
> has the same methods, but all requests from it sends
> with non-zero stream ID. Stream ID is generated on the
> client automatically. Simple example of stream creation
> using net.box:
> ```lua
> stream = conn:new_stream()
> -- all connection methods are valid, but send requests
> -- with non zero stream_id.
> ```
> ---
>  src/box/lua/net_box.c                         |  95 ++--
>  src/box/lua/net_box.lua                       | 205 ++++++--
>  test/box/access.result                        |   6 +-
>  test/box/access.test.lua                      |   6 +-
>  ...net.box_console_connections_gh-2677.result |   2 +-
>  ...t.box_console_connections_gh-2677.test.lua |   2 +-
>  .../net.box_incorrect_iterator_gh-841.result  |   4 +-
>  ...net.box_incorrect_iterator_gh-841.test.lua |   4 +-
>  test/box/net.box_iproto_hangs_gh-3464.result  |   2 +-
>  .../box/net.box_iproto_hangs_gh-3464.test.lua |   2 +-
>  .../net.box_long-poll_input_gh-3400.result    |   8 +-
>  .../net.box_long-poll_input_gh-3400.test.lua  |   8 +-
>  test/box/stream.lua                           |  13 +
>  test/box/stream.result                        | 485 ++++++++++++++++++
>  test/box/stream.test.lua                      | 182 +++++++

Please come up with a better test name. 'Stream' is way too generic.
Should be at least net.box.streams.

>  test/box/suite.ini                            |   2 +-
>  16 files changed, 934 insertions(+), 92 deletions(-)
>  create mode 100644 test/box/stream.lua
>  create mode 100644 test/box/stream.result
>  create mode 100644 test/box/stream.test.lua


More information about the Tarantool-patches mailing list