[Tarantool-patches] [PATCH v8 2/2] relay: provide information about downstream lag
Serge Petrenko
sergepetrenko at tarantool.org
Thu Jun 17 12:01:32 MSK 2021
17.06.2021 09:55, Cyrill Gorcunov пишет:
> 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;
Ok, I meant your description looks similar to upstream.lag.
>
> 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
>
I think I understand what you mean now. But still, this description is
confusing.
When you're saying it's "time delta when data is already written to a
replica's WAL"
it sounds like the delta is taken on replica, not on master. And that's
not true.
It's also unclear from this description that packet travel time (ack
from replica to master)
is included into downstream.lag
So I would reformulate the description to something like
"Downstream.lag is the lag between the main node writes a certain
transaction
to it's own WAL and the moment it receives an ack for this transaction
from a replica".
--
Serge Petrenko
More information about the Tarantool-patches
mailing list