From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Mon, 6 Aug 2018 11:42:52 +0300 From: Vladimir Davydov Subject: Re: [tarantool-patches] Re: [PATCH 24/25] Introduce _vinyl_deferred_delete system space Message-ID: <20180806084252.4z3zxyqlierv6if3@esperanza> References: <920a0685fd01546464585090dadf57732fa7a696.1532689066.git.vdavydov.dev@gmail.com> <20180731205427.GQ15235@chai> <20180801140018.ti22auajqiwlfyjn@esperanza> <20180801202501.GD15337@chai> <20180802094356.foz3jqbjqe347q2b@esperanza> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180802094356.foz3jqbjqe347q2b@esperanza> To: Konstantin Osipov Cc: tarantool-patches@freelists.org List-ID: On Thu, Aug 02, 2018 at 12:43:56PM +0300, Vladimir Davydov wrote: > On Wed, Aug 01, 2018 at 11:25:01PM +0300, Konstantin Osipov wrote: > > * Vladimir Davydov [18/08/01 18:14]: > > > On Tue, Jul 31, 2018 at 11:54:27PM +0300, Konstantin Osipov wrote: > > > > * Vladimir Davydov [18/07/27 16:55]: > > > > > The space is a blackhole. It will be used for writing deferred DELETE > > > > > statements generated by vinyl compaction tasks to WAL so that we can > > > > > recover deferred DELETEs that hadn't been dumped to disk before the > > > > > server was restarted. > > > > > > > > Why do you actually need a proto space for it? Please feel free to > > > > put blackhole engine first in the list of engines. > > > > > > You mean making this space purely virtual? No record in _space, no info > > > in snap file, just struct space in the cache? > > > > No, I mean no changes in sc_* methods, only a record in _space? > > But we need to install on_replace trigger on that space. OTOH we can do > that in vinyl_engine_bootstrap or vinyl_engine_begin_initial_recovery - > obviously the space isn't used during recovery from memtx snapshot, we > only need the trigger on final recovery. Looks reasonable. Is this what > you mean? I'm afraid we can't do that. The problem is _vinyl_deferred_delete space may not exist on recovery (when engine_begin_final_recovery is called), because box.schema.upgrade() hasn't been called yet. In this case we wouldn't be able to install the trigger as there's no proto space. We could probably disable the optimization until box.schema.upgrade() is called, but we wouldn't be able to enable it until restart... unless we detected creation of _vinyl_deferred_delete space in alter.cc, but that would be cumbersome IMO. That said, I guess, we have to create a proto space after all. In order not to clutter schema.cc we can probably do that in vinyl.c ...