memtx: allocate functional index key parts as tuples
Functional index keys are allocated and freed with MemtxAllocator's alloc and free methods. In contrast to tuples, which are allocated and freed with alloc_tuple and free_tuple, freeing a functional index key happens immediately, irrespective of whether there's a snapshot in progress or not. It's acceptable, because snapshot only uses primary indexes, which can't be functional. However, to reuse the snapshot infrastructure for creating general purpose user read views, we will need to guarantee that functional index keys stay alive until all read views using them are closed. To achieve that, this commit turns functional index keys into tuples, which automatically makes them linger if there's an open read view. We use the same global tuple format for allocating functional keys, because the key format is checked in key_list_iterator_next. Closes #7376 NO_DOC=refactoring NO_TEST=refactoring NO_CHANGELOG=refactoring
Showing
- src/box/key_list.c 17 additions, 11 deletionssrc/box/key_list.c
- src/box/key_list.h 8 additions, 16 deletionssrc/box/key_list.h
- src/box/memtx_engine.cc 9 additions, 0 deletionssrc/box/memtx_engine.cc
- src/box/memtx_engine.h 5 additions, 1 deletionsrc/box/memtx_engine.h
- src/box/memtx_tree.cc 38 additions, 72 deletionssrc/box/memtx_tree.cc
- src/box/tuple_compare.cc 3 additions, 3 deletionssrc/box/tuple_compare.cc
- test/wal_off/alter.result 1 addition, 1 deletiontest/wal_off/alter.result
Loading
Please register or sign in to comment