From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com [209.85.208.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id C9A99430D45 for ; Thu, 19 Mar 2020 12:06:38 +0300 (MSK) Received: by mail-lj1-f194.google.com with SMTP id u15so1250129lji.10 for ; Thu, 19 Mar 2020 02:06:38 -0700 (PDT) From: Cyrill Gorcunov Date: Thu, 19 Mar 2020 12:05:31 +0300 Message-Id: <20200319090537.5613-6-gorcunov@gmail.com> In-Reply-To: <20200319090537.5613-1-gorcunov@gmail.com> References: <20200319090537.5613-1-gorcunov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH v13 05/11] box/txn: move setup of txn start to txn_prepare List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tml For unification sake, we will handle nop transactions via common helper for both sync and async cases. Acked-by: Konstantin Osipov Signed-off-by: Cyrill Gorcunov --- src/box/txn.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/box/txn.c b/src/box/txn.c index 9f61303ab..6bb1b06ed 100644 --- a/src/box/txn.c +++ b/src/box/txn.c @@ -554,6 +554,8 @@ txn_prepare(struct txn *txn) trigger_clear(&txn->fiber_on_stop); if (!txn_has_flag(txn, TXN_CAN_YIELD)) trigger_clear(&txn->fiber_on_yield); + + txn->start_tm = ev_monotonic_now(loop()); return 0; } @@ -569,7 +571,6 @@ txn_commit_async(struct txn *txn) * After this point the transaction must not be used * so reset the corresponding key in the fiber storage. */ - txn->start_tm = ev_monotonic_now(loop()); if (txn->n_new_rows + txn->n_applier_rows == 0) { /* Nothing to do. */ txn->signature = 0; -- 2.20.1