[Tarantool-patches] [PATCH v3] memtx: fix out of memory handling for rtree

Konstantin Osipov kostja.osipov at gmail.com
Thu Dec 19 17:14:45 MSK 2019


* Olga Arkhangelskaia <arkholga at tarantool.org> [19/12/19 16:44]:
> When tarantool tries to recover rtree from a snapshot and memtx_memory value
> is lower than it has been when the snapshot was created, server suffers from
> segmentation fault. This happens because there is no out of memory error
> handling in rtree lib. In another words, we do not check the result of
> malloc operation.
> The execution flow in case of recovery uses different way and the secondary
> keys are build in batches. There is no separate implementations for rtree of
> build_next function. And the way with no checks and reservation is used
> (insex_replace). The patch adds memtx_rtree_build_next implementation to
> check and insert keys. Although this gives us no additional optimization as in
> case of memtx_tree, the memory reservation prevents tarantool from segmentation
> fault.
> If there is not enough memory to be reserved - server will fail
> gently with the "Failed to allocate" error message.

Why not add memtx_index_extent_reserve() to
generic_index_build_next(), this would be a shorter version which
does the same thing?


-- 
Konstantin Osipov, Moscow, Russia


More information about the Tarantool-patches mailing list