[tarantool-patches] Re: [PATCH 07/13] memtx: use ref counting to pin indexes for snapshot

Vladimir Davydov vdavydov.dev at gmail.com
Tue Aug 13 13:56:29 MSK 2019


On Tue, Aug 13, 2019 at 01:24:20AM +0300, Konstantin Osipov wrote:
> * Vladimir Davydov <vdavydov.dev at gmail.com> [19/08/10 23:22]:
> > Currently, to prevent an index from going away while it is being
> > written to a snapshot, we postpone memtx_gc_task's free() invocation
> > until checkpointing is complete, see commit 94de0a081b3a ("Don't take
> > schema lock for checkpointing"). This works fine, but makes it rather
> > difficult to reuse snapshot iterators for other purposes, e.g. feeding
> > a consistent read view to a newly joined replica.
> > 
> > Let's instead use index reference counting for pinning indexes for
> > checkpointing. A reference is taken in a snapshot iterator constructor
> > and released when the snapshot iterator is destroyed.
> 
> I don't see how this can work in general, memtx index can not live
> without memtx space and tuple format. These are not referenced
> from the index object.

A memtx index doesn't need to reference a space - we move indexes from
space to sapce on alter without any problems. Regarding the tuple
format, it is referenced by tuples anyway while tuples are referenced by
the primary index so we don't need to reference it explicitly.



More information about the Tarantool-patches mailing list