box: add is_sync option
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.
Showing
- changelogs/unreleased/gh-8650-add-is_sync-option.md 6 additions, 0 deletionschangelogs/unreleased/gh-8650-add-is_sync-option.md
- extra/exports 1 addition, 0 deletionsextra/exports
- src/box/applier.cc 13 additions, 1 deletionsrc/box/applier.cc
- src/box/iproto.cc 14 additions, 2 deletionssrc/box/iproto.cc
- src/box/iproto_constants.h 5 additions, 1 deletionsrc/box/iproto_constants.h
- src/box/lua/init.c 34 additions, 0 deletionssrc/box/lua/init.c
- src/box/lua/net_box.c 31 additions, 21 deletionssrc/box/lua/net_box.c
- src/box/lua/net_box.lua 81 additions, 5 deletionssrc/box/lua/net_box.lua
- src/box/lua/schema.lua 20 additions, 4 deletionssrc/box/lua/schema.lua
- src/box/txn.c 25 additions, 1 deletionsrc/box/txn.c
- src/box/txn.h 5 additions, 0 deletionssrc/box/txn.h
- src/box/xrow.c 56 additions, 0 deletionssrc/box/xrow.c
- src/box/xrow.h 28 additions, 2 deletionssrc/box/xrow.h
- test/box-luatest/gh_7894_export_iproto_constants_and_features_test.lua 1 addition, 0 deletions...est/gh_7894_export_iproto_constants_and_features_test.lua
- test/box-luatest/gh_8650_add_is_sync_option_test.lua 394 additions, 0 deletionstest/box-luatest/gh_8650_add_is_sync_option_test.lua
Loading