From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp3.mail.ru (smtp3.mail.ru [94.100.179.58]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id DC733445328 for ; Sun, 12 Jul 2020 20:15:57 +0300 (MSK) References: <1594221263-6228-1-git-send-email-alyapunov@tarantool.org> <1594221263-6228-4-git-send-email-alyapunov@tarantool.org> From: Vladislav Shpilevoy Message-ID: Date: Sun, 12 Jul 2020 19:15:56 +0200 MIME-Version: 1.0 In-Reply-To: <1594221263-6228-4-git-send-email-alyapunov@tarantool.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH 03/16] tx: introduce dirty tuples List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aleksandr Lyapunov , tarantool-patches@dev.tarantool.org 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); > + } > }