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 C7D646EC40; Fri, 13 Aug 2021 10:44:38 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org C7D646EC40 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1628840678; bh=65Z5PpA1UilRdCsAh8gv+G7vftJQuQwZjo+vB3CmZ3Q=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=lEi4RkYQdKvuyoqu1Zlab2KT/yPoHjDh2zN/YojVlvxyv1ukdjpSLCGZ7ZTd23l3F SbljJZnUDcE2a0T/+kYkKOzU3HqE433zDpqjVDtq/yCt4Ux6ILI4+lyaD0s3K+NOAE RIfEPUOTO2XzpPOUUYvMrC2chPTN+47wyFiRuHCA= 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 543E76EC40 for ; Fri, 13 Aug 2021 10:44:37 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 543E76EC40 Received: by smtpng1.m.smailru.net with esmtpa (envelope-from ) id 1mERro-0006Sw-9t; Fri, 13 Aug 2021 10:44:36 +0300 Date: Fri, 13 Aug 2021 10:44:35 +0300 To: Vladislav Shpilevoy Message-ID: <20210813074435.y2x5bswadxadowps@esperanza> References: <01ad18203fb09e1e4f1cb26e9a7db83a4d1e9087.1628759886.git.mechanik20051988@tarantool.org> <8a02aa62-0159-e535-174a-bcb1a5edf6b4@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8a02aa62-0159-e535-174a-bcb1a5edf6b4@tarantool.org> X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD92087353F0EC44DD91BCCB18F2C129F87F36E61E9E4584E9D182A05F5380850406F45087760E3A8FEC2AB9836B06FDEB2B738289F60ACDDC064A60420BC957EC4 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE75DF2B1F23425CAE5EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637B2BC59D094D41B978638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8148F2F8531C380BB408580F1A110172C117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC566404C906FA8ADEA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F4460429728776938767073520B28585415E75ADA96FD1C55BDD38FC3FD2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B613439FA09F3DCB32089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: 0D63561A33F958A5797579EF889FD7B91F79EF3AE0C5B194303BC9AA8F90FAB3D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA750E14360347543F58410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34D95739AEDB3821B49C19F1C08E2EA005F20F64EC0BCC6CB3C183A4056BAD055E2E541F503BCA5FEE1D7E09C32AA3244CB2BF35843532C4521DBF9E0776B60BDCBBA718C7E6A9E04283B48618A63566E0 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj0dLV0c3jbkxo6XNXQhN1qw== X-Mailru-Sender: 689FA8AB762F7393C37E3C1AEC41BA5D0BAE7DF07409A0C68B845C389DFCA44C274CEFED1673C562683ABF942079399BFB559BB5D741EB966A65DFF43FF7BE03240331F90058701C67EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v4 9/9] net.box: add interactive transaction support in 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 Cc: mechanik20051988 , tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" On Thu, Aug 12, 2021 at 08:52:30PM +0300, Vladislav Shpilevoy wrote: > > diff --git a/src/box/lua/net_box.lua b/src/box/lua/net_box.lua > > index 8d707fb26..f203b203e 100644 > > --- a/src/box/lua/net_box.lua > > +++ b/src/box/lua/net_box.lua > > @@ -754,11 +757,38 @@ local function stream_new_stream(stream) > > return stream._conn:new_stream() > > end > > > > +local function stream_begin(stream, opts) > > + check_remote_arg(stream, 'begin') > > + local res = stream:_request(M_BEGIN, opts, nil, stream._stream_id) > > + if opts and opts.is_async then > > + return res > > + end > > +end > > + > > +local function stream_commit(stream, opts) > > + check_remote_arg(stream, 'commit') > > + local res = stream:_request(M_COMMIT, opts, nil, stream._stream_id) > > + if opts and opts.is_async then > > + return res > > + end > > 2. Why can't you just return the result of :_request()? Isn't it > supposed to return the correct thing right away? For example, > remote_methods:execute() does it, space methods too. _request returns nil on success. I assume we want to return nothing, similarly to box.commit(). > > +end > > + > > +local function stream_rollback(stream, opts) > > + check_remote_arg(stream, 'rollback') > > + local res = stream:_request(M_ROLLBACK, opts, nil, stream._stream_id) > > + if opts and opts.is_async then > > + return res > > + end > > +end > > diff --git a/test/box/net.box_iproto_transactions_over_streams.result b/test/box/net.box_iproto_transactions_over_streams.result > > new file mode 100644 > > index 000000000..c2167e760 > > --- /dev/null > > +++ b/test/box/net.box_iproto_transactions_over_streams.result > > <...> > > > +--- > > +... > > +-- successful begin using stream:call > > +stream:call('box.begin') > > +--- > > +... > > +-- error: Operation is not permitted when there is an active transaction > > 3. Well, it does not look very successful like you said in > the comment. The test seems broken. It's not the command output, it's a comment :-) > > I didn't validate the others since I have very few time for that. > I hope Vova will take a closer look at the tests now despite he > has given LGTM already. > > (Or am I missing something and the test actually succeeds with > this weird output on purpose?) > > > +stream:eval('box.begin()') > > +--- > > +- error: 'Operation is not permitted when there is an active transaction ' > > +... > > +-- error: Operation is not permitted when there is an active transaction > > +stream:begin() > > +--- > > +- error: 'Operation is not permitted when there is an active transaction ' > > +... > > +-- error: Operation is not permitted when there is an active transaction > > +stream:execute('START TRANSACTION') > > +--- > > +- error: 'Operation is not permitted when there is an active transaction ' > > +... > > +stream:call('ping')