[Tarantool-patches] [PATCH 03/16] tx: introduce dirty tuples

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Sun Jul 12 20:15:56 MSK 2020


I still have the same question as in the previous review:

	How are the dirty tuples going to be used? Why don't we have such a flag
	for vinyl tuples?

> diff --git a/src/box/tuple.h b/src/box/tuple.h
> index 9a88772..4752323 100644
> --- a/src/box/tuple.h
> +++ b/src/box/tuple.h
> @@ -319,7 +319,13 @@ struct PACKED tuple
>  	/**
>  	 * Offset to the MessagePack from the begin of the tuple.
>  	 */
> -	uint16_t data_offset;
> +	uint16_t data_offset : 15;
> +	/**
> +	 * The tuple (if it's found in index for example) could be invisible
> +	 * for current transactions. The flag means that the tuple must
> +	 * be clarified by transaction engine.

What is current transaction? Assume, we can yield now. And there are
some transactions. A new transaction appears and adds a tuple to an index.
Will be it be visible for newer transactions? Since they are not 'current'
in terms of when the tuple was added. Or will it be visible to this
transaction only?

> +	 */
> +	bool is_dirty : 1;
>  	/**
>  	 * Engine specific fields and offsets array concatenated
>  	 * with MessagePack fields array.
> @@ -1081,8 +1087,10 @@ tuple_unref(struct tuple *tuple)
>  	assert(tuple->refs - 1 >= 0);
>  	if (unlikely(tuple->is_bigref))
>  		tuple_unref_slow(tuple);
> -	else if (--tuple->refs == 0)
> +	else if (--tuple->refs == 0) {
> +		assert(!tuple->is_dirty);

Why? Is something supposed to clear this flag after it is set?

>  		tuple_delete(tuple);
> +	}
>  }


More information about the Tarantool-patches mailing list