Tarantool development patches archive
 help / color / mirror / Atom feed
* [Tarantool-patches] [PATCH 0/4] Safe truncation and deletion
@ 2020-02-14 19:40 Ilya Kosarev
  2020-02-14 19:40 ` [Tarantool-patches] [PATCH 1/4] small: bump small version Ilya Kosarev
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Ilya Kosarev @ 2020-02-14 19:40 UTC (permalink / raw)
  To: tarantool-patches

This patchset is an experiment on reserve tech used for safe truncation
and the demonstration of the possible space:delete() fail on reserve.
The idea of the 3rd patch (memtx: use reserved slab for truncation) was
to prealloc a slab on arena to be used only for truncation tuples.
This approach didn't really solve the problem. After we are getting the
reserved slab with slab_map, we have a choice to put or not to put it
on slab lists. In case we do put it, the problem is that any next
operation, using mempool_alloc, will be able to use our slab, not only
truncation. This will lead to it's fast exhaustion. On the other hand,
if we skip all this lists (as it is done), we will fail at the garbage
collection when trying to free those tuples, as far as their slab won't
be found. See backtrace at
https://gitlab.com/tarantool/tarantool/-/jobs/438082894. It doesn't
look like there is any acceptable way to tune garbage collector
behavior.
In the 4th patch the stress_delete test with errinj is introduced to
show how it may fail on reserve. It uses errinj to simulate the case
where the num of reserved extents for memtx_index_extent_reserve won't
be enough, setting target amount as current amount + 1.

Not aimed to be pushed to master!

Branch: https://github.com/tarantool/tarantool/tree/i.kosarev/gh-3807-safe-alloc-on-truncation
Issue: https://github.com/tarantool/tarantool/issues/3807

Ilya Kosarev (4):
  small: bump small version
  b-tree: return NULL on matras_alloc fail
  memtx: use reserved slab for truncation
  memtx: space:delete() might fail on reserve

 src/box/box.cc                       |  27 ++++++-
 src/box/memtx_space.c                |  15 +++-
 src/box/tuple.c                      |   4 +
 src/lib/core/errinj.h                |   1 +
 src/lib/core/memory.c                |   1 +
 src/lib/salad/bps_tree.h             |  22 +++++-
 src/lib/small                        |   2 +-
 test/box/errinj.result               |   1 +
 test/engine/engine.cfg               |   6 ++
 test/engine/low_memory.lua           |   8 ++
 test/engine/stress_delete.result     | 111 +++++++++++++++++++++++++++
 test/engine/stress_delete.test.lua   |  55 +++++++++++++
 test/engine/stress_truncate.result   | 103 +++++++++++++++++++++++++
 test/engine/stress_truncate.test.lua |  52 +++++++++++++
 14 files changed, 399 insertions(+), 9 deletions(-)
 create mode 100644 test/engine/low_memory.lua
 create mode 100644 test/engine/stress_delete.result
 create mode 100644 test/engine/stress_delete.test.lua
 create mode 100644 test/engine/stress_truncate.result
 create mode 100644 test/engine/stress_truncate.test.lua

-- 
2.17.1

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-02-16 15:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-14 19:40 [Tarantool-patches] [PATCH 0/4] Safe truncation and deletion Ilya Kosarev
2020-02-14 19:40 ` [Tarantool-patches] [PATCH 1/4] small: bump small version Ilya Kosarev
2020-02-14 19:40 ` [Tarantool-patches] [PATCH 2/4] b-tree: return NULL on matras_alloc fail Ilya Kosarev
2020-02-14 19:40 ` [Tarantool-patches] [PATCH 3/4] memtx: use reserved slab for truncation Ilya Kosarev
2020-02-14 19:40 ` [Tarantool-patches] [PATCH 4/4] memtx: space:delete() might fail on reserve Ilya Kosarev
2020-02-14 22:48 ` [Tarantool-patches] [PATCH 0/4] Safe truncation and deletion Vladislav Shpilevoy
2020-02-15 15:33   ` Vladislav Shpilevoy
2020-02-15 16:34     ` Konstantin Osipov
2020-02-16 15:41       ` Vladislav Shpilevoy

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