[PATCH v2 2/7] vinyl: teach write iterator to return overwritten tuples

Vladimir Davydov vdavydov.dev at gmail.com
Tue Aug 21 18:37:54 MSK 2018


On Tue, Aug 21, 2018 at 06:14:57PM +0300, Konstantin Osipov wrote:
> * Vladimir Davydov <vdavydov.dev at gmail.com> [18/08/21 15:19]:
> >  	/*
> > +	 * Deferred DELETE statements can only be produced by
> > +	 * primary index compaction.
> > +	 */
> > +	assert(is_primary || handler == NULL);
> > +	/*
> 
> With this assert, do you really need this check:
> 
> > +static int
> > +vy_write_iterator_deferred_delete(struct vy_write_iterator *stream,
> > +				  struct tuple *stmt)
> > +{
> > +	if (!stream->is_primary)
> > +		return 0;
> 
> ?

Yes. When we dump a primary index, we set 'handler' to NULL, just like
for a secondary index, but in contrast to a secondary index, we have to
include the last statement marked as VY_STMT_DEFERRED_DELETE into the
iterator output even if it is not referenced by any read view, because
we will need it to generate a deferred DELETE statement on compaction.



More information about the Tarantool-patches mailing list