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

Georgy Kirichenko georgy at tarantool.org
Tue Aug 13 19:08:53 MSK 2019


On Tuesday, August 13, 2019 1:56:29 PM MSK Vladimir Davydov wrote:
> 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.
 I believe we should bound all index internal structures and corresponding 
tuple together as well as other schema members (spaces, functions, sequences).
It allows us to get rid of crappy alter.cc file and simplifies objects lifetime 
around transactional manager (which we do not have yet)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.tarantool.org/pipermail/tarantool-patches/attachments/20190813/77ff2b71/attachment.sig>


More information about the Tarantool-patches mailing list