[tarantool-patches] Re: [PATCH v2 2/7] vinyl: don't exempt dropped indexes from dump and compaction

Vladimir Davydov vdavydov.dev at gmail.com
Tue Aug 20 12:02:12 MSK 2019


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 <vdavydov.dev at gmail.com> [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;
 };



More information about the Tarantool-patches mailing list