[Tarantool-patches] [PATCH v8 2/2] relay: provide information about downstream lag

Cyrill Gorcunov gorcunov at gmail.com
Thu Jun 17 09:55:14 MSK 2021


On Tue, Jun 15, 2021 at 01:03:59PM +0300, Serge Petrenko wrote:
> > 
> > In other words this is a lag in seconds between the main node writes
> > data to own WAL and the replica `n` get this data replicated to own
> > WAL journal.
> 
> This is not true. You describe `upstream.lag` in this paragraph.
> Downstream lag is the time difference between the WAL write on master
> side and the receipt of an ack (confirmation of a WAL write on replica)
> for this transaction. Also on master side.

No. The upstream.lag is calulated as

applier_read_tx_row
  ...
  applier->lag = ev_now(loop()) - row->tm;

IOW it is a time between data is written to txn initiator to WAL and
the packet _received_ by replica, and there is no guarantee that the
packet will be *replicated* at all. In turn for downstream we compute
time delta when data is already writtent to a replica's WAL.

	Cyrill


More information about the Tarantool-patches mailing list