[Tarantool-patches] [PATCH v8 1/2] applier: send transaction's first row WAL time in the applier_writer_f
Cyrill Gorcunov
gorcunov at gmail.com
Wed Jun 16 16:32:38 MSK 2021
On Tue, Jun 15, 2021 at 12:36:02PM +0300, Serge Petrenko wrote:
> > @@ -193,6 +196,16 @@ applier_writer_f(va_list ap)
> > applier->has_acks_to_send = false;
> > struct xrow_header xrow;
> > xrow_encode_vclock(&xrow, &replicaset.vclock);
> > + /*
> > + * For relay lag statistics we report last
> > + * written transaction timestamp in tm field.
> > + *
> > + * Replica might be dead already so we have to
> > + * test on each iteration.
> > + */
> > + struct replica *r = replica_by_id(replica_id);
> > + if (likely(r != NULL))
> > + xrow.tm = r->applier_txn_start_tm;
>
> How could a replica be dead here?
> AFAIR we delete a replica only when it's deleted from _cluster. Shouldn't
> the applier writer be dead as well by that time?
Before accessing replica_by_id we're sitting in event loop trying to
fetch data from the network. Which means an admin may cleanup the
entry manually before we get back to this code in result we will
get a nil dereference (if only I'm not missing something).
More information about the Tarantool-patches
mailing list