txm: introduce transaction isolation levels
Now memtx TX manager tries to determine the best isolation level by itself. There could be two options: * READ_COMMITTED, when the transaction see changes of other tx that are committed but not yet confirmed (written to WAL) * READ_CONFIRMED, when the transaction see only confirmed changes. Introduce a simple way to specify the isolation level explicitly: box.begin{tx_isolation = 'default'} - the same as box.begin(). box.begin{tx_isolation = 'read-committed'} - READ_COMMITTED. box.begin{tx_isolation = 'read-confirmed'} - READ_CONFIRMED. box.begin{tx_isolation = 'best-effort'} - old automatic way. Intrduce a bit more complex but potentially faster way to set isolation level, like that: my_level = box.tnx_isolation_level.READ_COMMITTED .. box.begin{tx_isolation = my_level} For simplicity of implementation also support symmetric values as 'READ_COMMITTED' and box.tnx_isolation_level['read-committed']. Introduce a new box.cfg option - default_tx_isolation, that is used as a default when a transaction is started. The option is dynamic and possible values are the same as in box.begin, except 'default' which is meaningless. In addition to string value the corresponding numeric values can be used in both box.begin and box.cfg. Part of #6930 NO_DOC=see later commits NO_CHANGELOG=see later commits
Showing
- extra/exports 1 addition, 0 deletionsextra/exports
- src/box/box.cc 46 additions, 0 deletionssrc/box/box.cc
- src/box/box.h 6 additions, 0 deletionssrc/box/box.h
- src/box/lua/cfg.cc 9 additions, 0 deletionssrc/box/lua/cfg.cc
- src/box/lua/load_cfg.lua 4 additions, 0 deletionssrc/box/lua/load_cfg.lua
- src/box/lua/schema.lua 51 additions, 0 deletionssrc/box/lua/schema.lua
- src/box/memtx_tx.c 8 additions, 1 deletionsrc/box/memtx_tx.c
- src/box/txn.c 40 additions, 0 deletionssrc/box/txn.c
- src/box/txn.h 61 additions, 0 deletionssrc/box/txn.h
- test/app-tap/init_script.result 1 addition, 0 deletionstest/app-tap/init_script.result
- test/box-luatest/gh_6930_mvcc_isolation_levels_test.lua 176 additions, 0 deletionstest/box-luatest/gh_6930_mvcc_isolation_levels_test.lua
- test/box/admin.result 2 additions, 0 deletionstest/box/admin.result
- test/box/cfg.result 4 additions, 0 deletionstest/box/cfg.result
- test/box/misc.result 1 addition, 0 deletionstest/box/misc.result
Loading
Please register or sign in to comment