From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Georgy Kirichenko Subject: Re: [tarantool-patches] Re: [PATCH 07/13] memtx: use ref counting to pin indexes for snapshot Date: Tue, 13 Aug 2019 19:08:53 +0300 Message-ID: <1764733.5I11P83HaC@localhost> In-Reply-To: <20190813105629.GA13834@esperanza> References: <20190812222420.GZ32337@atlas> <20190813105629.GA13834@esperanza> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2471195.eyQxlhprOD"; micalg="pgp-sha256"; protocol="application/pgp-signature" To: tarantool-patches@freelists.org Cc: Vladimir Davydov , Konstantin Osipov List-ID: --nextPart2471195.eyQxlhprOD Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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 [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) --nextPart2471195.eyQxlhprOD Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEFZT35EtIMRTDS5hJnoTdFFzh6LUFAl1S4JUACgkQnoTdFFzh 6LXKsAf/XCRJDaVlp/D9+Sg2svfDF+tHBYvBLKu02hIm5darZfyDW0hRHN/Pb5Mt Pjc7sE2CpbPrCKSzKrpxl3qhXn0JLPfqhc7CWBU14h/crypca7Q5OSoHlXC2a6mX g1AAPX0j86zfr35dv4UMNbdR01QE+jNeyOLZcbUMp4nJ0/xwoLFQ17ibNJoInAof uecXA7fIVZmrt36JBbMeFNlc4ZfJVsp1K0sYn4XSmh+UlAEay9my4VB/ppHVTl0U ppOADLZCdCUmnLUdzxuvM5l3yuYBs3C/Yv1vYgwOB1ospsoOL3q6C3sjGXLIPg2q 5n6jZoVCdweYz5hBvOUDMaJKAK2xtQ== =RPXa -----END PGP SIGNATURE----- --nextPart2471195.eyQxlhprOD--