Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Cyrill Gorcunov <gorcunov@gmail.com>,
	tml <tarantool-patches@dev.tarantool.org>
Subject: Re: [Tarantool-patches] [PATCH 1/3] xrow: encode timestamp into vclock message
Date: Sun, 31 Jan 2021 18:43:53 +0100	[thread overview]
Message-ID: <84a18339-3eaf-477a-1bc2-71524c893ca3@tarantool.org> (raw)
In-Reply-To: <20210121171753.186891-2-gorcunov@gmail.com>

Hi! Thanks for the patch!

On 21.01.2021 18:17, Cyrill Gorcunov via Tarantool-patches wrote:
> The vclock message sent by "applierw" fiber to the replication
> master node operates not only for tracking status of applied data
> but also as a heartbeat packets (after 1.7.7).
> 
> The timestamp field of the xrow_header left zero here we can reuse
> it to track downstream node state by putting realtime value here.
> This won't break any existing instances without the patch because
> the field is unused anywhere yet.
> 
> Need to mention that xrow_encode_vclock used for other stages
> such as joining and encoding realtime value here won't hurt
> as well.

"Won't hurt" is not a good justification for adding a new field
to all vclocks we send everywhere. As well as it is not good to
add libev dependency to xrow internals. Better avoid adding something
"just in case". We need tm in applier heartbeats - lets add them to
there and only there.

You need tm in a single place - in applier_writer_f(), is it
correct? Just add a new function: xrow_encode_vclock_timed()
or something like this. It would take a timestamp. Like
xrow_encode_timestamp() does.

The old xrow_encode_vclock() would call xrow_encode_vclock_timed()
with 0 time, so there won't even be any code duplication.

> Part-of #5447
> 
> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
> ---
>  src/box/xrow.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/box/xrow.c b/src/box/xrow.c
> index bc06738ad..1a077fafd 100644
> --- a/src/box/xrow.c
> +++ b/src/box/xrow.c
> @@ -1648,6 +1648,7 @@ xrow_encode_vclock(struct xrow_header *row, const struct vclock *vclock)
>  	row->body[0].iov_base = buf;
>  	row->body[0].iov_len = (data - buf);
>  	row->bodycnt = 1;
> +	row->tm = ev_now(loop());
>  	row->type = IPROTO_OK;
>  	return 0;
>  }
> 

  reply	other threads:[~2021-01-31 17:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-21 17:17 [Tarantool-patches] [PATCH 0/3] box/info: report replication.X.downstream.lag Cyrill Gorcunov via Tarantool-patches
2021-01-21 17:17 ` [Tarantool-patches] [PATCH 1/3] xrow: encode timestamp into vclock message Cyrill Gorcunov via Tarantool-patches
2021-01-31 17:43   ` Vladislav Shpilevoy via Tarantool-patches [this message]
2021-01-21 17:17 ` [Tarantool-patches] [PATCH 2/3] box/info: report replication.X.downstream.lag value Cyrill Gorcunov via Tarantool-patches
2021-01-27 11:56   ` Serge Petrenko via Tarantool-patches
2021-01-27 12:12     ` Cyrill Gorcunov via Tarantool-patches
2021-01-27 14:04       ` Serge Petrenko via Tarantool-patches
2021-01-27 14:38         ` Cyrill Gorcunov via Tarantool-patches
2021-01-27 14:44           ` Serge Petrenko via Tarantool-patches
2021-01-31 17:45   ` Vladislav Shpilevoy via Tarantool-patches
2021-01-21 17:17 ` [Tarantool-patches] [PATCH 3/3] test: replication/status -- fetch downstream lag field Cyrill Gorcunov via Tarantool-patches
2021-01-31 17:46   ` Vladislav Shpilevoy via Tarantool-patches
2021-01-21 17:17 ` Cyrill Gorcunov via Tarantool-patches
2021-01-21 17:23   ` Cyrill Gorcunov via Tarantool-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=84a18339-3eaf-477a-1bc2-71524c893ca3@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=gorcunov@gmail.com \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 1/3] xrow: encode timestamp into vclock message' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox