[Tarantool-patches] [PATCH 04/10] box/txn: move setup of txn start to txn_prepare

Cyrill Gorcunov gorcunov at gmail.com
Wed Mar 18 15:38:34 MSK 2020


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.


More information about the Tarantool-patches mailing list