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
Please add possiblity to set is_sync=true in box.begin to enforce transaction to be synchronous #8650
Labels
feature
A new functionality
Comments
yanshtunder
added a commit
to yanshtunder/tarantool
that referenced
this issue
Jul 24, 2023
Added a new parameter `is_sync` to `box.begin()`, `box.commit()` and `box.atomic`. Thanks to this parameter can make the transaction synchronous. To do this set `is_sync = true`. `box.commit()` cannot change `is_sync` to `false` if the transaction was opened as synchronous or has writes to synchro spaces. By default, `is_sync = false`. Examples: ```Lua -- Sync transactions box.atomic({is_sync = true}, function() ... end) box.begin({is_sync = true}) ... box.commit({is_sync = false}) box.begin({is_sync = false}) ... box.commit({is_sync = true}) box.begin({is_sync = true}) ... box.commit({is_sync = true}) -- Async transactions box.atomic({is_sync = false}, function() ... end) box.begin({is_sync = false}) ... box.commit({is_sync = false}) box.begin() ... box.commit() ``` Closes tarantool#8650 NO_DOC=internal
yanshtunder
added a commit
to yanshtunder/tarantool
that referenced
this issue
Jul 31, 2023
Added the new `is_sync` parameter to `box.begin()`, `box.commit()`, and `box.atomic()`. To make the transaction synchronous, set the `is_sync` option to `true`. `box.commit()` can't change `is_sync` to `false` if the transaction was opened as synchronous or has writes to synchronous spaces. By default, `is_sync = false`. Examples: ```Lua -- Sync transactions box.atomic({is_sync = true}, function() ... end) box.begin({is_sync = true}) ... box.commit({is_sync = false}) box.begin({is_sync = false}) ... box.commit({is_sync = true}) box.begin({is_sync = true}) ... box.commit({is_sync = true}) -- Async transactions box.atomic({is_sync = false}, function() ... end) box.begin({is_sync = false}) ... box.commit({is_sync = false}) box.begin() ... box.commit() ``` Closes tarantool#8650 NO_DOC=internal
yanshtunder
added a commit
to yanshtunder/tarantool
that referenced
this issue
Jul 31, 2023
Added the new `is_sync` parameter to `box.begin()`, `box.commit()`, and `box.atomic()`. To make the transaction synchronous, set the `is_sync` option to `true`. `box.commit()` can't change `is_sync` to `false` if the transaction was opened as synchronous or has writes to synchronous spaces. By default, `is_sync = false`. Examples: ```Lua -- Sync transactions box.atomic({is_sync = true}, function() ... end) box.begin({is_sync = true}) ... box.commit({is_sync = false}) box.begin({is_sync = false}) ... box.commit({is_sync = true}) box.begin({is_sync = true}) ... box.commit({is_sync = true}) -- Async transactions box.atomic({is_sync = false}, function() ... end) box.begin({is_sync = false}) ... box.commit({is_sync = false}) box.begin() ... box.commit() ``` Closes tarantool#8650 NO_DOC=internal
yanshtunder
added a commit
to yanshtunder/tarantool
that referenced
this issue
Jul 31, 2023
Added the new `is_sync` parameter to `box.begin()`, `box.commit()`, and `box.atomic()`. To make the transaction synchronous, set the `is_sync` option to `true`. `box.commit()` can't change `is_sync` to `false` if the transaction was opened as synchronous or has writes to synchronous spaces. By default, `is_sync = false`. Examples: ```Lua -- Sync transactions box.atomic({is_sync = true}, function() ... end) box.begin({is_sync = true}) ... box.commit({is_sync = false}) box.begin({is_sync = false}) ... box.commit({is_sync = true}) box.begin({is_sync = true}) ... box.commit({is_sync = true}) -- Async transactions box.atomic({is_sync = false}, function() ... end) box.begin({is_sync = false}) ... box.commit({is_sync = false}) box.begin() ... box.commit() ``` Closes tarantool#8650 NO_DOC=internal
yanshtunder
added a commit
to yanshtunder/tarantool
that referenced
this issue
Jul 31, 2023
Added the new `is_sync` parameter to `box.begin()`, `box.commit()`, and `box.atomic()`. To make the transaction synchronous, set the `is_sync` option to `true`. `box.commit()` can't change `is_sync` to `false` if the transaction was opened as synchronous or has writes to synchronous spaces. By default, `is_sync = false`. Examples: ```Lua -- Sync transactions box.atomic({is_sync = true}, function() ... end) box.begin({is_sync = true}) ... box.commit({is_sync = false}) box.begin({is_sync = false}) ... box.commit({is_sync = true}) box.begin({is_sync = true}) ... box.commit({is_sync = true}) -- Async transactions box.atomic({is_sync = false}, function() ... end) box.begin({is_sync = false}) ... box.commit({is_sync = false}) box.begin() ... box.commit() ``` Closes tarantool#8650 NO_DOC=internal
yanshtunder
added a commit
to yanshtunder/tarantool
that referenced
this issue
Sep 7, 2023
Added the new is_sync parameter to `box.begin()`, `box.commit()`, and `box.atomic()`. To make the transaction synchronous, set the `is_sync` option to `true`. If to set any value other than `true/nil`, for example `is_sync = "some string"`, then an error will be thrown. Examples: ```Lua -- Sync transactions box.atomic({is_sync = true}, function() ... end) box.begin({is_sync = true}) ... box.commit({is_sync = true}) box.begin({is_sync = true}) ... box.commit() box.begin() ... box.commit({is_sync = true}) -- Async transactions box.atomic(function() ... end) box.begin() ... box.commit() ``` Closes tarantool#8650 NO_DOC=internal
yanshtunder
added a commit
to yanshtunder/tarantool
that referenced
this issue
Sep 26, 2023
Added the new is_sync parameter to `box.begin()`, `box.commit()`, and `box.atomic()`. To make the transaction synchronous, set the `is_sync` option to `true`. If to set any value other than `true/nil`, for example `is_sync = "some string"`, then an error will be thrown. Example: ```Lua -- Sync transactions box.atomic({is_sync = true}, function() ... end) box.begin({is_sync = true}) ... box.commit({is_sync = true}) box.begin({is_sync = true}) ... box.commit() box.begin() ... box.commit({is_sync = true}) -- Async transactions box.atomic(function() ... end) box.begin() ... box.commit() ``` Closes tarantool#8650 @TarantoolBot document Title: box.atomic({is_sync = true}) Added the new `is_sync` parameter to `box.atomic()`. To make the transaction synchronous, set the `is_sync` option to `true`. Setting `is_sync = false` is prohibited. If to set any value other than true for example `is_sync = "some string"`, then an error will be thrown.
yanshtunder
added a commit
to yanshtunder/tarantool
that referenced
this issue
Oct 4, 2023
Added the new is_sync parameter to `box.begin()`, `box.commit()`, and `box.atomic()`. To make the transaction synchronous, set the `is_sync` option to `true`. If to set any value other than `true/nil`, for example `is_sync = "some string"`, then an error will be thrown. Example: ```Lua -- Sync transactions box.atomic({is_sync = true}, function() ... end) box.begin({is_sync = true}) ... box.commit({is_sync = true}) box.begin({is_sync = true}) ... box.commit() box.begin() ... box.commit({is_sync = true}) -- Async transactions box.atomic(function() ... end) box.begin() ... box.commit() ``` Closes tarantool#8650 @TarantoolBot document Title: box.atomic({is_sync = true}) Added the new `is_sync` parameter to `box.atomic()`. To make the transaction synchronous, set the `is_sync` option to `true`. Setting `is_sync = false` is prohibited. If to set any value other than true for example `is_sync = "some string"`, then an error will be thrown.
yanshtunder
added a commit
to yanshtunder/tarantool
that referenced
this issue
Oct 11, 2023
Added the new is_sync parameter to `box.begin()`, `box.commit()`, and `box.atomic()`. To make the transaction synchronous, set the `is_sync` option to `true`. If to set any value other than `true/nil`, for example `is_sync = "some string"`, then an error will be thrown. Example: ```Lua -- Sync transactions box.atomic({is_sync = true}, function() ... end) box.begin({is_sync = true}) ... box.commit({is_sync = true}) box.begin({is_sync = true}) ... box.commit() box.begin() ... box.commit({is_sync = true}) -- Async transactions box.atomic(function() ... end) box.begin() ... box.commit() ``` Closes tarantool#8650 @TarantoolBot document Title: box.atomic({is_sync = true}) Added the new `is_sync` parameter to `box.atomic()`. To make the transaction synchronous, set the `is_sync` option to `true`. Setting `is_sync = false` is prohibited. If to set any value other than true for example `is_sync = "some string"`, then an error will be thrown.
yanshtunder
added a commit
to yanshtunder/tarantool
that referenced
this issue
Oct 11, 2023
Added the new is_sync parameter to `box.begin()`, `box.commit()`, and `box.atomic()`. To make the transaction synchronous, set the `is_sync` option to `true`. If to set any value other than `true/nil`, for example `is_sync = "some string"`, then an error will be thrown. Example: ```Lua -- Sync transactions box.atomic({is_sync = true}, function() ... end) box.begin({is_sync = true}) ... box.commit({is_sync = true}) box.begin({is_sync = true}) ... box.commit() box.begin() ... box.commit({is_sync = true}) -- Async transactions box.atomic(function() ... end) box.begin() ... box.commit() ``` Closes tarantool#8650 @TarantoolBot document Title: box.atomic({is_sync = true}) Added the new `is_sync` parameter to `box.atomic()`. To make the transaction synchronous, set the `is_sync` option to `true`. Setting `is_sync = false` is prohibited. If to set any value other than true for example `is_sync = "some string"`, then an error will be thrown.
yanshtunder
added a commit
to yanshtunder/tarantool
that referenced
this issue
Oct 18, 2023
Added the new is_sync parameter to `box.begin()`, `box.commit()`, and `box.atomic()`. To make the transaction synchronous, set the `is_sync` option to `true`. If to set any value other than `true/nil`, for example `is_sync = "some string"`, then an error will be thrown. Example: ```Lua -- Sync transactions box.atomic({is_sync = true}, function() ... end) box.begin({is_sync = true}) ... box.commit({is_sync = true}) box.begin({is_sync = true}) ... box.commit() box.begin() ... box.commit({is_sync = true}) -- Async transactions box.atomic(function() ... end) box.begin() ... box.commit() ``` Closes tarantool#8650 @TarantoolBot document Title: box.atomic({is_sync = true}) Added the new `is_sync` parameter to `box.atomic()`. To make the transaction synchronous, set the `is_sync` option to `true`. Setting `is_sync = false` is prohibited. If to set any value other than true for example `is_sync = "some string"`, then an error will be thrown.
yanshtunder
added a commit
to yanshtunder/tarantool
that referenced
this issue
Nov 2, 2023
Added the new is_sync parameter to `box.begin()`, `box.commit()`, and `box.atomic()`. To make the transaction synchronous, set the `is_sync` option to `true`. If to set any value other than `true/nil`, for example `is_sync = "some string"`, then an error will be thrown. Example: ```Lua -- Sync transactions box.atomic({is_sync = true}, function() ... end) box.begin({is_sync = true}) ... box.commit({is_sync = true}) box.begin({is_sync = true}) ... box.commit() box.begin() ... box.commit({is_sync = true}) -- Async transactions box.atomic(function() ... end) box.begin() ... box.commit() ``` Closes tarantool#8650 @TarantoolBot document Title: box.atomic({is_sync = true}) Added the new `is_sync` parameter to `box.atomic()`. To make the transaction synchronous, set the `is_sync` option to `true`. Setting `is_sync = false` is prohibited. If to set any value other than true for example `is_sync = "some string"`, then an error will be thrown.
yanshtunder
added a commit
to yanshtunder/tarantool
that referenced
this issue
Nov 8, 2023
Added the new is_sync parameter to `box.begin()`, `box.commit()`, and `box.atomic()`. To make the transaction synchronous, set the `is_sync` option to `true`. If to set any value other than `true/nil`, for example `is_sync = "some string"`, then an error will be thrown. Example: ```Lua -- Sync transactions box.atomic({is_sync = true}, function() ... end) box.begin({is_sync = true}) ... box.commit({is_sync = true}) box.begin({is_sync = true}) ... box.commit() box.begin() ... box.commit({is_sync = true}) -- Async transactions box.atomic(function() ... end) box.begin() ... box.commit() ``` Closes tarantool#8650 @TarantoolBot document Title: box.atomic({is_sync = true}) Added the new `is_sync` parameter to `box.atomic()`. To make the transaction synchronous, set the `is_sync` option to `true`. Setting `is_sync = false` is prohibited. If to set any value other than true for example `is_sync = "some string"`, then an error will be thrown.
yanshtunder
added a commit
to yanshtunder/tarantool
that referenced
this issue
Nov 20, 2023
Added a new is_sync parameter to `box.begin()`, `box.commit()`, and `box.atomic()`. To make the transaction synchronous, set the `is_sync` option to `true`. If any value other than `true/nil` is set, for example `is_sync = "some string"`, then an error will be thrown. Example: ```Lua -- Sync transactions box.atomic({is_sync = true}, function() ... end) box.begin({is_sync = true}) ... box.commit({is_sync = true}) box.begin({is_sync = true}) ... box.commit() box.begin() ... box.commit({is_sync = true}) -- Async transactions box.atomic(function() ... end) box.begin() ... box.commit() ``` Closes tarantool#8650 @TarantoolBot document Title: box.atomic({is_sync = true}) Added the new `is_sync` parameter to `box.atomic()`. To make the transaction synchronous, set the `is_sync` option to `true`. Setting `is_sync = false` is prohibited. If to set any value other than true for example `is_sync = "some string"`, then an error will be thrown.
sergepetrenko
pushed a commit
that referenced
this issue
Nov 29, 2023
Added a new is_sync parameter to `box.begin()`, `box.commit()`, and `box.atomic()`. To make the transaction synchronous, set the `is_sync` option to `true`. If any value other than `true/nil` is set, for example `is_sync = "some string"`, then an error will be thrown. Example: ```Lua -- Sync transactions box.atomic({is_sync = true}, function() ... end) box.begin({is_sync = true}) ... box.commit({is_sync = true}) box.begin({is_sync = true}) ... box.commit() box.begin() ... box.commit({is_sync = true}) -- Async transactions box.atomic(function() ... end) box.begin() ... box.commit() ``` Closes #8650 @TarantoolBot document Title: box.atomic({is_sync = true}) Added the new `is_sync` parameter to `box.atomic()`. To make the transaction synchronous, set the `is_sync` option to `true`. Setting `is_sync = false` is prohibited. If to set any value other than true for example `is_sync = "some string"`, then an error will be thrown.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Now we have is_sync-spaces, but most general use of Tarantool is still asynchronous spaces. Some operations with asynchronous spaces better be synchronous (ex.
queue:put{ ... }
or insert of some new data).Only developer knows when to make this specific transaction synchronous. Now we only can
:put{}
withwait_lsn
orbox.atomic
with update of garbage synchronous space, that looks odd.It would be better, if we could write
box.begin{is_sync=true} ... box.commit()
andbox.sync_atomic
when we want to make this specific transaction to be synchronous. Of course, this means that replicaset must be configured in full-mesh topology, and instance must be the synchronous queue owner.The text was updated successfully, but these errors were encountered: