From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id D49B42448E for ; Thu, 15 Aug 2019 07:03:21 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MTug0EA0x2En for ; Thu, 15 Aug 2019 07:03:21 -0400 (EDT) Received: from smtpng1.m.smailru.net (smtpng1.m.smailru.net [94.100.181.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 3870A23772 for ; Thu, 15 Aug 2019 07:03:21 -0400 (EDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: [tarantool-patches] Re: [PATCH 1/3] txn: move fk_deferred_count from psql_txn to txn From: "n.pettik" In-Reply-To: <1a4473c8-c4c7-faf4-3c27-54fd77a2532f@tarantool.org> Date: Thu, 15 Aug 2019 14:03:18 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: <27CE4324-3D92-4E89-B4BD-FFA7AD6C9A92@tarantool.org> References: <1a4473c8-c4c7-faf4-3c27-54fd77a2532f@tarantool.org> Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-Help: List-Unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-Subscribe: List-Owner: List-post: List-Archive: To: tarantool-patches@freelists.org Cc: Vladislav Shpilevoy > On 9 Aug 2019, at 23:59, Vladislav Shpilevoy = wrote: >=20 > Hi! Thanks for the patch! >=20 >> diff --git a/src/box/txn.h b/src/box/txn.h >> index 37d90932b..87e880a6a 100644 >> --- a/src/box/txn.h >> +++ b/src/box/txn.h >> @@ -213,6 +208,7 @@ struct txn { >> struct trigger fiber_on_stop; >> /** Commit and rollback triggers. */ >> struct rlist on_commit, on_rollback; >> + uint32_t fk_deferred_count; >=20 > Please, add a comment. A detailed one. That this number is used > by SQL only, what does it mean 'deferred fk', why is it stored > in the transaction. Done: diff --git a/src/box/txn.h b/src/box/txn.h index 87e880a6a..f795cb76f 100644 --- a/src/box/txn.h +++ b/src/box/txn.h @@ -208,6 +208,17 @@ struct txn { struct trigger fiber_on_stop; /** Commit and rollback triggers. */ struct rlist on_commit, on_rollback; + /** + * This member represents counter of deferred foreign key + * violations within transaction. DEFERRED mode means + * that until transaction is committed violations are + * allowed to appear. However, transaction can't be + * committed in presence of violations, i.e. if this + * counter is not equal to zero. In the normal mode + * violations of FK are checked at the end of each + * statement processing. Note that at the moment it is + * SQL specific property. + */ uint32_t fk_deferred_count; struct sql_txn *psql_txn; };