From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp43.i.mail.ru (smtp43.i.mail.ru [94.100.177.103]) (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 D30E2469719 for ; Tue, 15 Sep 2020 20:59:22 +0300 (MSK) Date: Tue, 15 Sep 2020 17:59:21 +0000 From: Nikita Pettik Message-ID: <20200915175921.GC23208@tarantool.org> References: <1599560532-27089-1-git-send-email-alyapunov@tarantool.org> <1599560532-27089-11-git-send-email-alyapunov@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1599560532-27089-11-git-send-email-alyapunov@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH v4 10/12] txm: use new tx manager in memtx List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aleksandr Lyapunov Cc: tarantool-patches@dev.tarantool.org On 08 Sep 13:22, Aleksandr Lyapunov wrote: > index ba818d0..ed2ce82 100644 > --- a/src/box/txn.h > +++ b/src/box/txn.h > @@ -620,12 +620,16 @@ txn_check_singlestatement(struct txn *txn, const char *where); > * as aborted, which results in rolling back the transaction on > * commit. > * > - * This function is used by the memtx engine, because it doesn't > - * support yields inside transactions. It is also used to temporarily > - * enable yields for long DDL operations such as building an index > - * or checking a space format. > + * > + * This function is used by the memtx engine, because there are cases > + * when if doesn't support yields inside transactions. It is also ..if -> it? > + * used to temporarily enable yields for long DDL operations such as > + * building an index or checking a space format. > + * > + * Return previous state of the flag: true - yields were enabled, > + * false - yields were disabled before the function call. > */ > -void > +bool > txn_can_yield(struct txn *txn, bool set); > > /** > diff --git a/src/box/vinyl.c b/src/box/vinyl.c > index aa6e50f..cee39c5 100644 > --- a/src/box/vinyl.c > +++ b/src/box/vinyl.c > @@ -1076,7 +1076,7 @@ vinyl_space_check_format(struct space *space, struct tuple_format *format) > return -1; > > /* See the comment in vinyl_space_build_index(). */ > - txn_can_yield(txn, true); > + bool could_yield = txn_can_yield(txn, true); Don't get why vinyl related functions should be involved in this change.. The rest is OK. > struct trigger on_replace; > struct vy_check_format_ctx ctx; > @@ -1128,7 +1128,7 @@ vinyl_space_check_format(struct space *space, struct tuple_format *format) > out: > diag_destroy(&ctx.diag); > trigger_clear(&on_replace); > - txn_can_yield(txn, false); > + txn_can_yield(txn, could_yield); > return rc; > } > > @@ -4175,7 +4175,7 @@ vinyl_space_build_index(struct space *src_space, struct index *new_index, > * change the data dictionary, so there is no dirty state > * that can be observed. > */ > - txn_can_yield(txn, true); > + bool could_yield = txn_can_yield(txn, true); > > /* > * Iterate over all tuples stored in the space and insert > @@ -4276,7 +4276,7 @@ vinyl_space_build_index(struct space *src_space, struct index *new_index, > out: > diag_destroy(&ctx.diag); > trigger_clear(&on_replace); > - txn_can_yield(txn, false); > + txn_can_yield(txn, could_yield); > return rc; > } > > -- > 2.7.4 >