From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-f68.google.com (mail-lf1-f68.google.com [209.85.167.68]) (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 DD42C4696C7 for ; Wed, 19 Feb 2020 21:38:49 +0300 (MSK) Received: by mail-lf1-f68.google.com with SMTP id b15so942565lfc.4 for ; Wed, 19 Feb 2020 10:38:49 -0800 (PST) From: Cyrill Gorcunov Date: Wed, 19 Feb 2020 21:37:07 +0300 Message-Id: <20200219183713.17646-9-gorcunov@gmail.com> In-Reply-To: <20200219183713.17646-1-gorcunov@gmail.com> References: <20200219183713.17646-1-gorcunov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH 08/14] box/txn: move setup of transaction start time to txn_prepare List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tml It is more logical to put this timestamp in prepare state. Also this will allow us to reuse the txn_prepare code. Note the former code did the same -- this member get set right after txn_prepare call so nothing changed. 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 0ad596c1e..3a784b18b 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