From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com [209.85.208.195]) (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 17165469719 for ; Wed, 18 Mar 2020 15:38:37 +0300 (MSK) Received: by mail-lj1-f195.google.com with SMTP id f13so26855456ljp.0 for ; Wed, 18 Mar 2020 05:38:36 -0700 (PDT) Date: Wed, 18 Mar 2020 15:38:34 +0300 From: Cyrill Gorcunov Message-ID: <20200318123834.GS27301@uranus> References: <20200305122943.7324-1-gorcunov@gmail.com> <20200305122943.7324-5-gorcunov@gmail.com> <20200306213003.GD8140@atlas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200306213003.GD8140@atlas> 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: Konstantin Osipov , tml On Sat, Mar 07, 2020 at 12:30:03AM +0300, Konstantin Osipov wrote: > > + > > + /* > > + * 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. Kostya, I happen to miss this comment. Look, as far as I understand this is not about yields, but this timing is used to detect if the write itself takes too long time. if (stop_tm - txn->start_tm > too_long_threshold) { int n_rows = txn->n_new_rows + txn->n_applier_rows; say_warn_ratelimited("too long WAL write: %d rows at " "LSN %lld: %.3f sec", n_rows, txn->signature - n_rows + 1, stop_tm - txn->start_tm); } That's why I put into the comment that we should save time value at the very end of commit procedure. > > Otherwise lgtm.