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 7BA3A6EC40; Sat, 14 Aug 2021 11:03:27 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 7BA3A6EC40 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1628928207; bh=tXDSXObGb5TzU9dXrv/Nsj4azvXRM+wupFf2R3TWWIE=; h=To:References:Date:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=yJHCxClF1WAI6NZh3b/gJjvX8EhLXEh16+mFJax6rDw6ol9v446Rcd3T5FPeuxCSM U5tXS/xmscvgoxJGGW5b69c3ddSLTP7pwE60aZ04UWNbZmUbKMwWZ7RYAwkGTbCHi5 Mj1Fos8h63aVcimJvTotMS5Is0/EpcSTwZ3arqkE= Received: from smtp50.i.mail.ru (smtp50.i.mail.ru [94.100.177.110]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 771B66EC40 for ; Sat, 14 Aug 2021 11:03:25 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 771B66EC40 Received: by smtp50.i.mail.ru with esmtpa (envelope-from ) id 1mEodY-0006rR-EC; Sat, 14 Aug 2021 11:03:24 +0300 To: Vitaliia Ioffe References: <20210813142546.41696-1-sergepetrenko@tarantool.org> <1628923373.481086215@f108.i.mail.ru> Message-ID: <10e00de4-ef9f-b8c9-ed57-ba79989daffa@tarantool.org> Date: Sat, 14 Aug 2021 11:03:23 +0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <1628923373.481086215@f108.i.mail.ru> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD92087353F0EC44DD9736CF3E71F18CE0C3E1D5927724F4AAA182A05F538085040CEF882136DF1A957864C05B3A392C81D5DC57736C9A3299C6D2D81523318F4C0 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE755BE8F535441E38CEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637FD169B9D7A3022168638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D82E633C8951B1B8266DA231B7E447C1D2117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC2EE5AD8F952D28FBA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352033AC447995A7AD18CB629EEF1311BF91D2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EE7B96B19DC40933214AAC223A686B1DECD8FC6C240DEA7642DBF02ECDB25306B2B78CF848AE20165D0A6AB1C7CE11FEE362B3BD3CC35DA588C0837EA9F3D19764C4224003CC836476EA7A3FFF5B025636E2021AF6380DFAD1A18204E546F3947CB11811A4A51E3B096D1867E19FE1407959CC434672EE6371089D37D7C0E48F6C8AA50765F7900637EC3198ECE464ADAEEFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-C1DE0DAB: 0D63561A33F958A52AD5CB95C40A4C8370A6A1A8531E3C8E0EB626676C4C4B9AD59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA752DA3D96DA0CEF5C48E8E86DC7131B365E7726E8460B7C23C X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34AE88D5ADEBE7C983B6C44CC16FFF3F8F7CB2CE0ED71A59A9E12B64605642C17EF3048A91E185022A1D7E09C32AA3244CDF0EDF86AC5B6D61B939CAD64A44736395A9E0DC41E9A4CFFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj57i8v0hCSFIzK52DFFM/Jg== X-Mailru-Sender: 583F1D7ACE8F49BD31DE23046B3A8460A721F804A1CC175171FC2B54CA845432E436CDC11A29B0206BB2E709EA627F343C7DDD459B58856F0E45BC603594F5A135B915D4279FF0579437F6177E88F7363CDA0F3B3F5B9367 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH] applier: fix upstream.lag calculations 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: Serge Petrenko via Tarantool-patches Reply-To: Serge Petrenko Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" 14.08.2021 09:42, Vitaliia Ioffe пишет: > Hi Sergey, > I’m so sorry for saying it: but this fix is not a fix. I have to > underline there were failed tests: > > [037] replication/errinj.test.lua                 memtx           [ fail ] > > [037] replication/errinj.test.lua                   vinyl            >   [ fail ] > You can find it here: > https://github.com/tarantool/tarantool/runs/3322606890 > -- > Vitaliia Ioffe Don't be sorry, I didn't check the patch thoroughly enough. Applied the following diff and reworded the patch a bit. Everything should be fine now. =================================== diff --git a/test/replication/errinj.result b/test/replication/errinj.result index 9d13f6aa7..ec251182f 100644 --- a/test/replication/errinj.result +++ b/test/replication/errinj.result @@ -308,7 +308,10 @@ box.info.replication[1].upstream.lag > 0  ---  - true  ... -box.info.replication[1].upstream.lag < 1 +-- Upstream lag is huge until the first row is received. +test_run:wait_cond(function()\ +    return box.info.replication[1].upstream.lag < 1\ +end)  ---  - true  ... diff --git a/test/replication/errinj.test.lua b/test/replication/errinj.test.lua index 19234ab35..7f6535ec1 100644 --- a/test/replication/errinj.test.lua +++ b/test/replication/errinj.test.lua @@ -130,7 +130,10 @@ test_run:cmd("switch replica")  while box.info.replication[1].upstream.status ~= 'follow' do fiber.sleep(0.0001) end  box.info.replication[1].upstream.status  box.info.replication[1].upstream.lag > 0 -box.info.replication[1].upstream.lag < 1 +-- Upstream lag is huge until the first row is received. +test_run:wait_cond(function()\ +    return box.info.replication[1].upstream.lag < 1\ +end)  -- wait for ack timeout  test_run:wait_upstream(1, {status='disconnected', message_re='unexpected EOF'}) =================================== > > Пятница, 13 августа 2021, 17:25 +03:00 от Serge Petrenko > : > upstream.lag is the delta between the moment when a row was written to > master's journal and the moment when it was received by the replica. > It's an important metric to check whether the replica has fallen > too far > behind master. > > Not all the rows coming from master have a valid time of creation. For > example, RAFT system messages don't have one, and we can't assign > correct time to them: these messages do not originate from the > journal, > and assigning current time to them would lead to jumps in upstream.lag > results. > > Stop updating upstream.lag for rows which don't have creation time > assigned. > > This also fixes the flaky replication/errinj.test.lua > --- > https://github.com/tarantool/tarantool/tree/sp/applier-lag-fix > > >  src/box/applier.cc | 3 ++- >  1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/src/box/applier.cc b/src/box/applier.cc > index 902d0bc72..9256078e1 100644 > --- a/src/box/applier.cc > +++ b/src/box/applier.cc > @@ -664,7 +664,8 @@ applier_read_tx_row(struct applier *applier, > double timeout) > >   coio_read_xrow_timeout_xc(coio, ibuf, row, timeout); > > - applier->lag = ev_now(loop()) - row->tm; > + if (row->tm > 0) > + applier->lag = ev_now(loop()) - row->tm; >   applier->last_row_time = ev_monotonic_now(loop()); >   return tx_row; >  } > -- > 2.30.1 (Apple Git-130) > -- Serge Petrenko