From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp50.i.mail.ru (smtp50.i.mail.ru [94.100.177.110]) (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 BCE74445320 for ; Thu, 16 Jul 2020 03:08:01 +0300 (MSK) References: <1594821336-14468-1-git-send-email-alyapunov@tarantool.org> <1594821336-14468-7-git-send-email-alyapunov@tarantool.org> From: Vladislav Shpilevoy Message-ID: Date: Thu, 16 Jul 2020 02:08:00 +0200 MIME-Version: 1.0 In-Reply-To: <1594821336-14468-7-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 v3 06/13] txm: add TX status List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aleksandr Lyapunov , tarantool-patches@dev.tarantool.org Thanks for the patch! Firstly, I agree with all comments from Nikita. > diff --git a/src/box/txn.h b/src/box/txn.h > index 36b1a03..e261852 100644 > --- a/src/box/txn.h > +++ b/src/box/txn.h > @@ -121,6 +121,40 @@ enum { > }; > > /** > + * Status of a transaction. > + */ > +enum txn_status { > + /** > + * Initial state of TX. The only state of a TX that allowed to do Lets follow the code style and keep the comments in 66 symbols border. In this commit and in all the others. > + * read or write actions. > + */ > + TXN_INPROGRESS, > + /** > + * The TX have passed conflict checks and is ready to be committed. > + */ > + TXN_PREPARED, > + /** > + * The TX was aborted when other TX was committed due to conflict. > + */ > + TXN_CONFLICTED, > + /** > + * The TX was read_only, has a conflict and was sent to read view. > + * Read-only and does not participate in conflict resolution ever more. > + * This transaction can onlu see state of the database at some fixed > + * point in the past. > + */ > + TXN_IN_READ_VIEW, > + /** > + * The TX was committed. > + */ > + TXN_COMMITTED, > + /** > + * The TX was aborted by user. > + */ > + TXN_ABORTED, > +}; I started a ticket for follow-up optimisations. I suggest to collect all of them here: https://github.com/tarantool/tarantool/issues/5172. The ones which are trivial and don't need separate tickets.