txm: disallow yields after DDL operation in TX
To avoid sharing (ergo phantom reads) metadata object for different transactions in MVCC mode, let's do following things. Firstly, let's set on replace trigger on all system spaces (content's change in system space is considered to be DDL operation) which disables yields until transaction is committed. The only exceptions are index build and space format check: during these operations yields are allowed since they may take a while (so without yields they block execution). Actually it is not a problem 'cause these two operations must be first-in-transaction: as a result transaction can't contain two yielding statements. So after any cache modification no yields take place for sure. Secondly, on committing transaction that provides DDL changes let's abort all other transaction since they may refer to obsolete schema objects. The last restriction may seem too strict, but it is OK as primitive workaround until transactional DDL is introduced. In fact we should only abort transactions that have read dirty (i.e. modified) objects. Closes #5998 Closes #6140 Workaround for #6138
Showing
- changelogs/unreleased/gh-5998-disallow-yields-ddl.md 4 additions, 0 deletionschangelogs/unreleased/gh-5998-disallow-yields-ddl.md
- changelogs/unreleased/gh-6140-fix-mvcc-crash-in-ddl-rollback.md 4 additions, 0 deletions...logs/unreleased/gh-6140-fix-mvcc-crash-in-ddl-rollback.md
- src/box/alter.cc 31 additions, 4 deletionssrc/box/alter.cc
- src/box/memtx_engine.c 2 additions, 0 deletionssrc/box/memtx_engine.c
- src/box/memtx_space.c 0 additions, 6 deletionssrc/box/memtx_space.c
- src/box/memtx_tx.c 21 additions, 0 deletionssrc/box/memtx_tx.c
- src/box/memtx_tx.h 15 additions, 0 deletionssrc/box/memtx_tx.h
- src/box/schema.cc 13 additions, 0 deletionssrc/box/schema.cc
- src/box/txn.c 1 addition, 0 deletionssrc/box/txn.c
- src/box/txn.h 2 additions, 0 deletionssrc/box/txn.h
- src/box/vinyl.c 0 additions, 22 deletionssrc/box/vinyl.c
- test/box/gh-5998-one-tx-for-ddl-errinj.result 131 additions, 0 deletionstest/box/gh-5998-one-tx-for-ddl-errinj.result
- test/box/gh-5998-one-tx-for-ddl-errinj.test.lua 53 additions, 0 deletionstest/box/gh-5998-one-tx-for-ddl-errinj.test.lua
- test/box/gh-5998-one-tx-for-ddl.result 237 additions, 0 deletionstest/box/gh-5998-one-tx-for-ddl.result
- test/box/gh-5998-one-tx-for-ddl.test.lua 94 additions, 0 deletionstest/box/gh-5998-one-tx-for-ddl.test.lua
- test/box/suite.ini 1 addition, 1 deletiontest/box/suite.ini
- test/box/tx_man.result 2 additions, 63 deletionstest/box/tx_man.result
- test/box/tx_man.test.lua 1 addition, 19 deletionstest/box/tx_man.test.lua
- test/engine/errinj_ddl.result 6 additions, 7 deletionstest/engine/errinj_ddl.result
- test/engine/errinj_ddl.test.lua 5 additions, 2 deletionstest/engine/errinj_ddl.test.lua
Loading