memtx: add stubs to keep track of upgraded read view tuples
If a read view is created while space upgrade is in progress, tuples fetched from the read view may be either upgraded or not. We need to be able to differentiate those tuples so that we can use the appropriate tuple format for them. To achieve that this commit adds the following function stubs: - memtx_space_upgrade_track_tuple and memtx_space_upgrade_untrack_tuple will be used to maintain a set of all upgraded tuples. - memtx_read_view_tuple_needs_upgrade will do a lookup in the set of all upgraded tuples to check if a tuple needs upgrade. The stubs will be implemented in the EE repository. Note that we have to call memtx_space_upgrade_untrack_tuple from memtx_engine_rollback_statement. The problem is that the space may be deleted while a transaction is inprogress, in which case we must not access space->upgrade in memtx_engine_rollback_statement. Fortunately, we call memtx_tx_on_space_delete when a memtx space is altered to rollback memtx transactions. So to handle this situation we set txn_stmt->engine_savepoint to NULL from memtx_tx_history_remove_stmt called from memtx_tx_on_space_delete. This makes the rollback function return early. Needed for tarantool/tarantool-ee#236 NO_DOC=ee NO_TEST=ee NO_CHANGELOG=ee
Showing
- src/box/index.h 7 additions, 0 deletionssrc/box/index.h
- src/box/memtx_engine.cc 17 additions, 4 deletionssrc/box/memtx_engine.cc
- src/box/memtx_space.c 2 additions, 0 deletionssrc/box/memtx_space.c
- src/box/memtx_space_upgrade.h 47 additions, 0 deletionssrc/box/memtx_space_upgrade.h
- src/box/memtx_tx.c 1 addition, 0 deletionssrc/box/memtx_tx.c
Loading
Please register or sign in to comment