memtx: decompress tuples in snapshot iterator
Compressed tuples aren't supposed to be seen outside memtx internals: we always decompresses tuples before returning them to the user; tuples are written decompressed to xlog. We should also decompress tuples before writing them to a snapshot or sending them to a remote replica, but currently we don't, which results in a crash trying to recover from a snapshot that contains compressed spaces. This patch fixes this by decompressing all tuples in snapshot iterator. Since the decompressed tuples are allocated on the region, we should also call fiber_gc() after each snapshot iterator iteration. Note that the decompression is unconditional, i.e. we try to decompress all tuples stored in an index. In general we can't figure out if a tuple is compressed, because its format may be unavailable (when a tuple is freed, its format_id is overwritten). Needed for https://github.com/tarantool/tarantool-ee/issues/171 NO_DOC=bug fix NO_TEST=ee NO_CHANGELOG=ee
Showing
- src/box/memtx_engine.cc 2 additions, 0 deletionssrc/box/memtx_engine.cc
- src/box/memtx_hash.cc 4 additions, 1 deletionsrc/box/memtx_hash.cc
- src/box/memtx_tree.cc 4 additions, 1 deletionsrc/box/memtx_tree.cc
- src/box/memtx_tuple_compression.h 8 additions, 0 deletionssrc/box/memtx_tuple_compression.h
Loading
Please register or sign in to comment