From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id C34B16EC40; Wed, 11 Aug 2021 15:09:13 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org C34B16EC40 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1628683753; bh=O8zFoD4mFddkZ3sV57d2uVR4bcS/UFaCDrccuUPqElU=; h=Date:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=DalFVnvty1BLXfZQYywtLN5wo9OMxsF3UW2IlKeaY23is5d9q2kFGaii6aHYni8TN QAr5miMz2cVr9fKEW11Xt7aZR2RZpqGVtuoU5n3miAZ3kFQhPOp0rcC+DCeBSTOjks JKLn/X4mw4Wy6H3ga5G4pq99lVr1oUQJWqXrBPf4= Received: from smtpng1.i.mail.ru (smtpng1.i.mail.ru [94.100.181.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 6D8306EC40 for ; Wed, 11 Aug 2021 15:09:12 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 6D8306EC40 Received: by smtpng1.m.smailru.net with esmtpa (envelope-from ) id 1mDn2l-0000MN-Ig; Wed, 11 Aug 2021 15:09:11 +0300 Date: Wed, 11 Aug 2021 15:09:10 +0300 To: mechanik20051988 Cc: tarantool-patches@dev.tarantool.org, v.shpilevoy@tarantool.org, mechanik20051988 Message-ID: <20210811120910.2y4aycdn5giqmyvd@esperanza> References: <56db4eea5c868187e151658427e1a6d65736771a.1628671235.git.mechanik20051988@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56db4eea5c868187e151658427e1a6d65736771a.1628671235.git.mechanik20051988@tarantool.org> X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD92087353F0EC44DD9D5AC6413C25DCF08CC98B8FCC5CD86F3182A05F53808504020869A98CFFED2BF8109C68E7CADEDF6FA6257822783E8DD4DD82DC485C7FEFD X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7227E4400968B082FEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063750E64749F09C4ED58638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8B21E067F846A04E8A8213F7ECD11F8E6117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC3733B5EC72352B9FA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F44604297287769387670735201E561CDFBCA1751F618001F51B5FD3F9D2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B613439FA09F3DCB32089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: 0D63561A33F958A592C47927C7E55437D936DBC52FC70B9308676DC7F9C3AEA1D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA753177526CD55AFC11410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34F8A2DF183797A6A89718451DA4FC69D848BA2BC5C715BEA83FA2FC0823F520D8F5CF21BCF231776C1D7E09C32AA3244CC4D7CB11477D2ABAA1F22D10AD54D4557C0C08F7987826B983B48618A63566E0 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj6qlzQV0oSZMfg8nsB+Beig== X-Mailru-Sender: 689FA8AB762F7393C37E3C1AEC41BA5DD397F9EC6B8E825B3110D8E7E142FB6B274CEFED1673C562683ABF942079399BFB559BB5D741EB966A65DFF43FF7BE03240331F90058701C67EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v3 6/8] net.box: add stream support to net.box X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Vladimir Davydov via Tarantool-patches Reply-To: Vladimir Davydov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" On Wed, Aug 11, 2021 at 11:56:56AM +0300, mechanik20051988 wrote: > From: mechanik20051988 > > 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