Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add interactive transaction support in net.box #2311

Closed
TarantoolBot opened this issue Aug 23, 2021 · 2 comments · Fixed by #2878
Closed

add interactive transaction support in net.box #2311

TarantoolBot opened this issue Aug 23, 2021 · 2 comments · Fixed by #2878
Assignees
Labels
feature A new functionality reference [location] Tarantool manual, Reference part server [area] Task relates to Tarantool's server (core) functionality

Comments

@TarantoolBot
Copy link
Collaborator

TarantoolBot commented Aug 23, 2021

Product: Tarantool
Since: 2.10.0-beta1
Root document: https://www.tarantool.io/en/doc/latest/reference/reference_lua/net_box/
SME: @ alyapunov

Details

Implement begin, commit and rollback methods for stream object
in net.box, which allows to begin, commit and rollback transaction
accordingly. Now there are multiple ways to begin, commit and rollback
transaction from net.box: using appropriate stream methods, using 'callor 'eval' methods or usingexecutemethod with sql transaction syntax. User can mix these methods, for example, start transaction usingstream:begin(), and commit transaction using stream:call('box.commit')`
or stream:execute('COMMIT').
Simple example of using interactive transactions via iproto from net.box:

stream = conn:new_stream()
space = stream.space.test
space_not_from_stream = conn.space.test

stream:begin()
space:replace({1})
-- return previously inserted tuple, because request
-- belongs to transaction.
space:select({})
-- empty select, because select doesn't belongs to
-- transaction
space_not_from_stream:select({})
stream:call('box.commit')
-- now transaction was commited, so all requests
-- returns tuple.

Different examples of using streams you can find in
gh-5860-implement-streams-in-iproto.test.lua (https://github.com/tarantool/tarantool/blob/master/test/box/net.box_iproto_transactions_over_streams.test.lua)
Requested by @EvgenyMekhanik in tarantool/tarantool@f9ca802.

Related to #2308 and #2310

@art-dr art-dr added this to the Estimate [@arctic_dreamer] milestone Sep 14, 2021
@art-dr art-dr added server [area] Task relates to Tarantool's server (core) functionality feature A new functionality reference [location] Tarantool manual, Reference part labels Sep 14, 2021
@art-dr art-dr changed the title add interactive transaction support in net.box [3pt?] add interactive transaction support in net.box Sep 14, 2021
@art-dr art-dr modified the milestones: Estimate [@arctic_dreamer], Stream related issues Sep 22, 2021
@art-dr art-dr changed the title [3pt?] add interactive transaction support in net.box [5pt] add interactive transaction support in net.box Sep 22, 2021
@patiencedaur
Copy link
Contributor

This is described in the Streams chapter. We might need to add links and short descriptions on the net.box page.

@patiencedaur
Copy link
Contributor

Related issue: #2308

@patiencedaur patiencedaur assigned art-dr and unassigned xuniq Feb 10, 2022
@patiencedaur patiencedaur added 3sp and removed 5sp labels Mar 9, 2022
@patiencedaur patiencedaur added 5sp and removed 5sp labels Apr 25, 2022
@veod32 veod32 added 1sp and removed 3sp labels May 4, 2022
@veod32 veod32 removed this from the streams milestone May 12, 2022
@rindblack15 rindblack15 changed the title [5pt] add interactive transaction support in net.box add interactive transaction support in net.box May 16, 2022
@rindblack15 rindblack15 linked a pull request May 18, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new functionality reference [location] Tarantool manual, Reference part server [area] Task relates to Tarantool's server (core) functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants