From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f196.google.com (mail-lj1-f196.google.com [209.85.208.196]) (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 45C99469719 for ; Sat, 7 Mar 2020 00:30:05 +0300 (MSK) Received: by mail-lj1-f196.google.com with SMTP id r7so3714591ljp.10 for ; Fri, 06 Mar 2020 13:30:05 -0800 (PST) Date: Sat, 7 Mar 2020 00:30:03 +0300 From: Konstantin Osipov Message-ID: <20200306213003.GD8140@atlas> References: <20200305122943.7324-1-gorcunov@gmail.com> <20200305122943.7324-5-gorcunov@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200305122943.7324-5-gorcunov@gmail.com> Subject: Re: [Tarantool-patches] [PATCH 04/10] 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: Cyrill Gorcunov Cc: tml * Cyrill Gorcunov [20/03/05 15:32]: > For unification sake, we will handle nop transactions > via common helper for both sync and async cases. > > Signed-off-by: Cyrill Gorcunov > --- > src/box/txn.c | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > > diff --git a/src/box/txn.c b/src/box/txn.c > index 9f61303ab..5dd52e6db 100644 > --- a/src/box/txn.c > +++ b/src/box/txn.c > @@ -554,6 +554,15 @@ 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); > + > + /* > + * It is important to set start transaction > + * time at the last moment, when everything > + * is ready to initiate commit procedure, > + * just to be more precise in timings to > + * detect long WAL writes. > + */ I think this comment is misleading. There are no yields between start of txn_prepare() and end. There may appear yields when vinyl lock manager is more smart, but there are no yields now. So ev_monotonic_now returns exactly the same value regardless of where you call it. Otherwise lgtm. > + txn->start_tm = ev_monotonic_now(loop()); > return 0; > } > -- Konstantin Osipov, Moscow, Russia