From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 62E2A70310; Wed, 27 Jan 2021 15:13:04 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 62E2A70310 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1611749584; bh=bYS5+DZSEuuMpumLaJuhuus1yCuvjLXg7K8/Ku3kJno=; h=Date:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=E1ANVt14h6J46qGAn3qJ9NiGzSK7ux41jRYGyZcd78iG55YOipL2tLwD93Y+oiJYD OC5wED+JzckQXdutfmB2FwiQheQoaSS7Tsk6GQIlldZL4tfrS1LHh1kmDG8S2OLTfF FtVgYIzm9T8AXhVjx2U+x8HnDRdE1dm1+fYUPy38= Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 8DFBD70310 for ; Wed, 27 Jan 2021 15:13:02 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 8DFBD70310 Received: by mail-lj1-f174.google.com with SMTP id y11so1829960ljk.1 for ; Wed, 27 Jan 2021 04:13:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=GnOGLiJct6cWdTK4JuulCGxVzBcnVRxDldhLzMCgYdo=; b=IPbg4rDevO7K9594c/0RoibtzhwRlef957M9u1RWdvetQe32AkjK6FuTdmt8coKu+6 /pCEoTST/pYuuSoqZVKRYL64/cyUXPXFfUasexEsotsJhJw1TLSycO82UdcUi4iQmIEP p26DnWOh7Py2CM5ckLrlhB+NjTXmZMBbdRAR5K1sRLFZi8HDW6gyWIsR15maH+LIYsfQ XQUXJZMvknHtLSnyWCv6kremuZZhWQ3xSVSoSXizRaFXIsoanfDfYmKAGnLCojiZ3xR+ B/wn8dJiVNTbhNEJe3Z8ONM86Qspe6BwYZVtyBaM7O19/ziKQdRxzYV1kSIicjHXRPK/ rjiA== X-Gm-Message-State: AOAM531PjICSRPEjbz0UlbrTQfuFWs0oCufeZ96E21FlR9ToFWjHv/1X oG2k2QSSMMMVixYDIzBob1Go8PnZzxQ= X-Google-Smtp-Source: ABdhPJxIlQAjRpb7CWxulThqG2bZEPo9sUNu4n9gsLcu/cZhJoNk7u8d4ZoU3iN8miKA+9Fe6vzzzA== X-Received: by 2002:a2e:91d0:: with SMTP id u16mr5690095ljg.480.1611749581420; Wed, 27 Jan 2021 04:13:01 -0800 (PST) Received: from grain.localdomain ([5.18.91.94]) by smtp.gmail.com with ESMTPSA id o26sm443416lfd.262.2021.01.27.04.12.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Jan 2021 04:13:00 -0800 (PST) Received: by grain.localdomain (Postfix, from userid 1000) id 61F0456009B; Wed, 27 Jan 2021 15:12:59 +0300 (MSK) Date: Wed, 27 Jan 2021 15:12:59 +0300 To: Serge Petrenko Cc: tml , Vladislav Shpilevoy Message-ID: <20210127121259.GK2174@grain> References: <20210121171753.186891-1-gorcunov@gmail.com> <20210121171753.186891-3-gorcunov@gmail.com> <14c1c58c-0645-0262-e70d-3bf92aa88a49@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <14c1c58c-0645-0262-e70d-3bf92aa88a49@tarantool.org> User-Agent: Mutt/1.14.6 (2020-07-11) Subject: Re: [Tarantool-patches] [PATCH 2/3] box/info: report replication.X.downstream.lag value X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Cyrill Gorcunov via Tarantool-patches Reply-To: Cyrill Gorcunov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" On Wed, Jan 27, 2021 at 02:56:52PM +0300, Serge Petrenko wrote: > > switch(relay_get_state(relay)) { > > - case RELAY_FOLLOW: > > + case RELAY_FOLLOW: { > > The brace should go on a new line. OK > > @@ -558,6 +568,13 @@ relay_reader_f(va_list ap) > > /* vclock is followed while decoding, zeroing it. */ > > vclock_create(&relay->recv_vclock); > > xrow_decode_vclock_xc(&xrow, &relay->recv_vclock); > > + /* > > + * Old versions may send not a timestamp but > > + * zeroified memory field. We can use +0 as > > + * as sign that there is nothing encoded. > > typo: as a sign. Thanks! Force pushed an update --- src/box/lua/info.c | 3 ++- src/box/relay.cc | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/box/lua/info.c b/src/box/lua/info.c index b36c2e6f4..1e533fe8d 100644 --- a/src/box/lua/info.c +++ b/src/box/lua/info.c @@ -132,7 +132,8 @@ lbox_pushrelay(lua_State *L, struct relay *relay) lua_pushstring(L, "status"); switch(relay_get_state(relay)) { - case RELAY_FOLLOW: { + case RELAY_FOLLOW: + { double lag = relay_lag(relay); lua_pushstring(L, "follow"); lua_settable(L, -3); diff --git a/src/box/relay.cc b/src/box/relay.cc index 9265a26b3..a486db23a 100644 --- a/src/box/relay.cc +++ b/src/box/relay.cc @@ -571,7 +571,7 @@ relay_reader_f(va_list ap) /* * Old versions may send not a timestamp but * zeroified memory field. We can use +0 as - * as sign that there is nothing encoded. + * as a sign that there is nothing encoded. */ if (xrow.tm != 0) relay->lag = ev_now(loop()) - xrow.tm; -- 2.29.2