From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (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 B52DC431780 for ; Sat, 22 Aug 2020 00:59:45 +0300 (MSK) References: <20200819213442.1099018-1-gorcunov@gmail.com> <20200819213442.1099018-6-gorcunov@gmail.com> <1597999873.222856578@f425.i.mail.ru> From: Vladislav Shpilevoy Message-ID: Date: Fri, 21 Aug 2020 23:59:44 +0200 MIME-Version: 1.0 In-Reply-To: <1597999873.222856578@f425.i.mail.ru> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [Tarantool-patches] [PATCH v9 5/7] applier: process synchro requests without txn engine List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Serge Petrenko , Cyrill Gorcunov Cc: tml Hi! Thanks for the review! > diff --git a/src/box/applier.cc b/src/box/applier.cc > index 1387d518c..c1d07ca54 100644 > --- a/src/box/applier.cc > +++ b/src/box/applier.cc > @@ -847,13 +923,26 @@ applier_apply_tx(struct stailq *rows) >   } >   } >   > + if (unlikely(iproto_type_is_synchro_request(first_row->type))) { > + /* > + * Synchro messages are not transactions, in terms > + * of DML. Always sent and written isolated from > + * each other. > + */ > + assert(first_row == last_row); > + if (apply_synchro_row(first_row) != 0) > + diag_raise(); > + goto success; > + } > + >   /** >   * Explicitly begin the transaction so that we can >   * control fiber->gc life cycle and, in case of apply >   * conflict safely access failed xrow object and allocate >   * IPROTO_NOP on gc. >   */ > - struct txn *txn = txn_begin(); > + struct txn *txn; > + txn = txn_begin(); > >   > Why this change? In C++ you can't declare and assign variables bypassing labels (at least in clang). It won't compile. Here a new label is added - 'success:'. But it appeared, that it still allows to declare a variable and assign it on a next line. So here it is done.