From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Tue, 20 Aug 2019 12:02:12 +0300 From: Vladimir Davydov Subject: Re: [tarantool-patches] Re: [PATCH v2 2/7] vinyl: don't exempt dropped indexes from dump and compaction Message-ID: <20190820090212.GT13834@esperanza> References: <67030c30de327fbceaf2c204eec11a3745869533.1566233187.git.vdavydov.dev@gmail.com> <20190819204700.GC21602@atlas> <20190820081227.GQ13834@esperanza> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190820081227.GQ13834@esperanza> To: Konstantin Osipov Cc: tarantool-patches@freelists.org List-ID: On Tue, Aug 20, 2019 at 11:12:27AM +0300, Vladimir Davydov wrote: > On Mon, Aug 19, 2019 at 11:47:00PM +0300, Konstantin Osipov wrote: > > * Vladimir Davydov [19/08/19 19:57]: > > > vy_lsm_read_set_t read_set; > > > + /** > > > + * Triggers run when the last reference to this LSM tree > > > + * is dropped and the LSM tree is about to be destroyed. > > > + * A pointer to this LSM tree is passed to the trigger > > > + * callback in the 'event' argument. > > > + */ > > > + struct rlist on_destroy; > > > > Please explain in the comment that the compaction scheduler task takes a > > reference as well, so if the dropped index happens to be compacted > > at the moment, it will be dropped only when the compaction task > > finishes. > > True. We could avoid that, but for now it isn't worth bothering about > IMO. I'll add a comment. Here goes the comment: diff --git a/src/box/vy_lsm.h b/src/box/vy_lsm.h index 47f8ee6a..3b553ea5 100644 --- a/src/box/vy_lsm.h +++ b/src/box/vy_lsm.h @@ -317,6 +317,13 @@ struct vy_lsm { * is dropped and the LSM tree is about to be destroyed. * A pointer to this LSM tree is passed to the trigger * callback in the 'event' argument. + * + * For instance, this trigger is used to remove a dropped + * LSM tree from the scheduler before it gets destroyed. + * Since each dump/compaction task takes a reference to + * the target index, this means that a dropped index will + * not get destroyed until all tasks scheduled for it have + * been completed. */ struct rlist on_destroy; };