[PATCH 8/8] memtx: run garbage collection on demand

Konstantin Osipov kostja at tarantool.org
Tue May 22 17:00:20 MSK 2018


* Vladimir Davydov <vdavydov.dev at gmail.com> [18/05/22 15:10]:
> When a memtx space is dropped or truncated, we delegate freeing tuples
> stored in it to a background fiber so as not to block the caller (and tx
> thread) for too long. Turns out it doesn't work out well for ephemeral
> spaces, which share the destruction code with normal spaces: the problem
> is the user might issue a lot of complex SQL SELECT statements that
> create a lot of ephemeral spaces and do not yield and hence don't give
> the garbage collection fiber a chance to clean up. There's a test that
> emulates this, 2.0:test/sql-tap/gh-3083-ephemeral-unref-tuples.test.lua.
> For this test to pass, let's run garbage collection procedure on demand,
> i.e. when any of memtx allocation functions fails to allocate memory.

The patch looks good to me, except the signature of run_gc, which
should be changed from the previous patch..

We're getting really close for capped collections with this patch,
but a log structured allocator would fit in really nicely before
that.


-- 
Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
http://tarantool.io - www.twitter.com/kostja_osipov



More information about the Tarantool-patches mailing list