Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladimir Davydov via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Cc: mechanik20051988 <mechanik20.05.1988@gmail.com>,
	tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH v4 9/9] net.box: add interactive transaction support in net.box
Date: Fri, 13 Aug 2021 10:44:35 +0300	[thread overview]
Message-ID: <20210813074435.y2x5bswadxadowps@esperanza> (raw)
In-Reply-To: <8a02aa62-0159-e535-174a-bcb1a5edf6b4@tarantool.org>

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')

  reply	other threads:[~2021-08-13  7:44 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-12  9:50 [Tarantool-patches] [PATCH v4 0/9] implement iproto streams mechanik20051988 via Tarantool-patches
2021-08-12  9:50 ` [Tarantool-patches] [PATCH v4 1/9] xrow: remove unused call_request::header mechanik20051988 via Tarantool-patches
2021-08-12  9:50 ` [Tarantool-patches] [PATCH v4 2/9] iproto: clear request::header for client requests mechanik20051988 via Tarantool-patches
2021-08-12  9:50 ` [Tarantool-patches] [PATCH v4 3/9] iproto: implement stream id in binary iproto protocol mechanik20051988 via Tarantool-patches
2021-08-12  9:50 ` [Tarantool-patches] [PATCH v4 4/9] salad: fix segfault in case when mhash table allocation failure mechanik20051988 via Tarantool-patches
2021-08-12  9:50 ` [Tarantool-patches] [PATCH v4 5/9] iproto: implement streams in iproto mechanik20051988 via Tarantool-patches
2021-08-12  9:50 ` [Tarantool-patches] [PATCH v4 6/9] net.box: add stream support to net.box mechanik20051988 via Tarantool-patches
2021-08-12 17:49   ` Vladislav Shpilevoy via Tarantool-patches
2021-08-12  9:50 ` [Tarantool-patches] [PATCH v4 7/9] iproto: add RAFT prefix for all requests related to 'raft' mechanik20051988 via Tarantool-patches
2021-08-12  9:50 ` [Tarantool-patches] [PATCH v4 8/9] iproto: implement interactive transactions over iproto streams mechanik20051988 via Tarantool-patches
2021-08-12 10:48   ` Vladimir Davydov via Tarantool-patches
2021-08-12  9:50 ` [Tarantool-patches] [PATCH v4 9/9] net.box: add interactive transaction support in net.box mechanik20051988 via Tarantool-patches
2021-08-12 17:52   ` Vladislav Shpilevoy via Tarantool-patches
2021-08-13  7:44     ` Vladimir Davydov via Tarantool-patches [this message]
2021-08-12 10:51 ` [Tarantool-patches] [PATCH v4 0/9] implement iproto streams Vladimir Davydov via Tarantool-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210813074435.y2x5bswadxadowps@esperanza \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=mechanik20.05.1988@gmail.com \
    --cc=v.shpilevoy@tarantool.org \
    --cc=vdavydov@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v4 9/9] net.box: add interactive transaction support in net.box' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox