Tarantool development patches archive
 help / color / mirror / Atom feed
From: Konstantin Osipov <kostja.osipov@gmail.com>
To: Olga Arkhangelskaia <arkholga@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH v3] memtx: fix out of memory handling for rtree
Date: Thu, 19 Dec 2019 17:14:45 +0300	[thread overview]
Message-ID: <20191219141445.GA26708@atlas> (raw)
In-Reply-To: <20191219134126.25839-1-arkholga@tarantool.org>

* Olga Arkhangelskaia <arkholga@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

  reply	other threads:[~2019-12-19 14:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-19 13:41 Olga Arkhangelskaia
2019-12-19 14:14 ` Konstantin Osipov [this message]
2019-12-19 14:45   ` Olga Arkhangelskaia
2019-12-19 15:09     ` Konstantin Osipov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191219141445.GA26708@atlas \
    --to=kostja.osipov@gmail.com \
    --cc=arkholga@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v3] memtx: fix out of memory handling for rtree' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox