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 3FDFA6EC40; Fri, 13 Aug 2021 17:25:51 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 3FDFA6EC40 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1628864751; bh=3SnrjXxpKJ4YrRim9d1e7AY93JFjAunetL5ttxUcxRs=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=T4YGwTahg1exnFjdgzW97PPQy0gUE46sTK/tkhp6Y7C2n4DvwQJaaTnrvZ0wlulc2 uqTRhU6KL4at+C0KjDe+gQZN9eumDx9imtZG4TfaKdnIgVMNyMImW+grYJzoxdLF+r vRqVLSQlamfjrTe4oUR0jkR35QAFiq58Qu/qeRhY= Received: from smtp40.i.mail.ru (smtp40.i.mail.ru [94.100.177.100]) (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 333B56EC40 for ; Fri, 13 Aug 2021 17:25:50 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 333B56EC40 Received: by smtp40.i.mail.ru with esmtpa (envelope-from ) id 1mEY84-0005KE-U3; Fri, 13 Aug 2021 17:25:49 +0300 To: v.ioffe@tarantool.org, kyukhin@tarantool.org Date: Fri, 13 Aug 2021 17:25:46 +0300 Message-Id: <20210813142546.41696-1-sergepetrenko@tarantool.org> X-Mailer: git-send-email 2.30.1 (Apple Git-130) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD92087353F0EC44DD9F9A2272A1D086A28553D1D5C4B4124EF182A05F538085040294A904A6378173458767A9A27FF53E7951E87462107A14B512E470E4D1AA910 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE797F4D2EDC29AFAF7EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006379108F895B68B2FFD8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8E07B47D462F7534A5243D8542A95172D117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC3733B5EC72352B9FA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F44604297287769387670735201E561CDFBCA1751F6FD1C55BDD38FC3FD2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EE41BF15D38FB6CB3AC766E17BBE5724E9D8FC6C240DEA7642DBF02ECDB25306B2B78CF848AE20165D0A6AB1C7CE11FEE386D40F53BA192295BA3038C0950A5D36B5C8C57E37DE458B0BC6067A898B09E46D1867E19FE14079C09775C1D3CA48CF3D321E7403792E342EB15956EA79C166A417C69337E82CC275ECD9A6C639B01B78DA827A17800CE765B758295022C166731C566533BA786AA5CC5B56E945C8DA X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C4C7A0BC55FA0FE5FC2FC00C47D57772D0303D6FC8FC916F30F860E04DE3A6DE69B1881A6453793CE9C32612AADDFBE06114206303DEBBBF109510FB958DCE06DB6ED91DBE5ABE359A805C47957401F4812272C4C079A4C8AD93EDB24507CE13387DFF0A840B692CF8 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D345C064E16D8ABF335EE0E07A18B489DB9F5D542380B39C959DF392553E3E7A01218C38D470338946E1D7E09C32AA3244CCAA8D95CA0D71CF321D5EFC2F4A10FC96C24832127668422927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj0dLV0c3jbky/o+Ni6uIDvQ== X-Mailru-Sender: 583F1D7ACE8F49BD31DE23046B3A84608D10D2146BC6C0FCA7C8642D06E21CE239C604822A0450876BB2E709EA627F343C7DDD459B58856F0E45BC603594F5A135B915D4279FF0579437F6177E88F7363CDA0F3B3F5B9367 X-Mras: Ok Subject: [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" 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)