box: make functional index creation transactional
The _func_index space trigger used to reject an insertion of a tuple that defines an invalid functional index. As insertion in _index space had been completed before, a garbage is kept in _index space in such case. We need to do something with the yelding _func_index trigger(that rebuilds an index) to wrap all index creation operation in DDL transaction in further patches (because only the first DDL operation may yeld now). This problem could be trivially solved with preparatory initialization of index_def function ponter: the memtx_tree index construction would perform all required job in such case. Therefore the following index rebuild in _func_index trigger becomes redundant and should be omitted. In other words, a trivial prefetch operation makes possible a transactional index creation (with space:create_index operation). As for index construction during recovery (a lack of function cache during recovery was the main motivation to introduce _func_index space), it's workflow is kept unchanged. Follow up #1250 Needed for #4348 Closes #4401
Showing
- src/box/alter.cc 50 additions, 6 deletionssrc/box/alter.cc
- src/box/index_def.h 12 additions, 0 deletionssrc/box/index_def.h
- test/engine/func_index.result 87 additions, 9 deletionstest/engine/func_index.result
- test/engine/func_index.test.lua 41 additions, 3 deletionstest/engine/func_index.test.lua
Loading
Please register or sign in to comment