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 EFACD6EC55; Tue, 15 Jun 2021 13:04:02 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org EFACD6EC55 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1623751443; bh=vfbcbGE+wqMM0oO1B1YrMy6uF3jwf+3pZcXIgdBIRFc=; 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=rQxFRRqb+kD9uO0a/IPUZvA0Kd7+uFzHq6CdYfmSc+vJkEqgG6UiS/xlr2B5D3t7j rU3gZUmZ63g8RPSMMnvgeT54Y4qEjFacSTrzDCUcgUiqMfN7sp5i05WZihjluCLTms LjMHaa+hnJuQslLr+51LgMDHLrQ1VzvXSWPzw1Bw= Received: from smtp56.i.mail.ru (smtp56.i.mail.ru [217.69.128.36]) (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 3B2FC6EC55 for ; Tue, 15 Jun 2021 13:04:02 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 3B2FC6EC55 Received: by smtp56.i.mail.ru with esmtpa (envelope-from ) id 1lt5vM-0006a9-SQ; Tue, 15 Jun 2021 13:04:01 +0300 To: Cyrill Gorcunov , tml References: <20210607155519.109626-1-gorcunov@gmail.com> <20210607155519.109626-3-gorcunov@gmail.com> Message-ID: <73be2a27-dacf-c750-7bb6-da777b9c2f5a@tarantool.org> Date: Tue, 15 Jun 2021 13:03:59 +0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210607155519.109626-3-gorcunov@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9D5B0DA836B685C54F4BC37E91F2690B85F43D7652182C513182A05F5380850408D8BC05ED6C49913C69A23BE67AF3EC2A0809872D2F1ADC3C89CEDCEC6BE9590 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7956F10FFCC7409BAEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637802D3462438662818638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8531459DA27EB57D1D610A34F43AD152C117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC8C7ADC89C2F0B2A5A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F44604297287769387670735201E561CDFBCA1751FF04B652EEC242312D2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B6B67FC62909E22F84089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: 0D63561A33F958A5F31F99B9E4FE8FD513994D24E930594898927A84F4A29879D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75FBC5FED0552DA851410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34AEC7C2AC3C44791D010783F15036E52A5BE0397F931BD8BD1F25DBEA6E81D71067E1BB4392CCB6A81D7E09C32AA3244CB2BBBA365F19A334D7257EBFBE18FE4C3FD9C8CA1B0515E0927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj6OL1iHTyIM0O1jMpFYl12A== X-Mailru-Sender: 3B9A0136629DC9125D61937A2360A4467940B9BBA521742FBCFF1ABD9C4E5B02506B6831E712E9CA424AE0EB1F3D1D21E2978F233C3FAE6EE63DB1732555E4A8EE80603BA4A5B0BC112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v8 2/2] relay: provide information about downstream lag 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: Vladislav Shpilevoy Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" 07.06.2021 18:55, Cyrill Gorcunov пишет: > We already have `box.replication.upstream.lag` entry for monitoring > sake. Same time in synchronous replication timeouts are key properties > for quorum gathering procedure. Thus we would like to know how long > it took of a transaction to traverse `initiator WAL -> network -> > remote applier -> ACK` path. Hi! Thanks for the patch! Please, find a couple of comments below. > > Typical output is > > | tarantool> box.info.replication[2].downstream > | --- > | - status: follow > | idle: 0.61753897101153 > | vclock: {1: 147} > | lag: 0 > | ... > | tarantool> box.space.sync:insert{69} > | --- > | - [69] > | ... > | > | tarantool> box.info.replication[2].downstream > | --- > | - status: follow > | idle: 0.75324084801832 > | vclock: {1: 151} > | lag: 0.0011014938354492 > | ... > > Closes #5447 > > Signed-off-by: Cyrill Gorcunov > > @TarantoolBot document > Title: Add `box.info.replication[n].downstream.lag` entry > > `replication[n].downstream.lag` is the time difference between > last transactions been written to the WAL journal of the transaction > initiator and the transaction written to WAL on the `n` replica. > > In other words this is a lag in seconds between the main node writes > data to own WAL and the replica `n` get this data replicated to own > WAL journal. This is not true. You describe `upstream.lag` in this paragraph. Downstream lag is the time difference between the WAL write on master side and the receipt of an ack (confirmation of a WAL write on replica) for this transaction. Also on master side. > > In case if a transaction failed to replicate the lag value won't be > modified because only successfully applied transactions are accounted. > Same time if the main node or a repllica get restarted the lag value > will be zero until next success transaction. > --- > .../unreleased/gh-5447-downstream-lag.md | 6 ++ > src/box/lua/info.c | 3 + > src/box/relay.cc | 50 ++++++++++ > src/box/relay.h | 6 ++ > .../replication/gh-5447-downstream-lag.result | 93 +++++++++++++++++++ > .../gh-5447-downstream-lag.test.lua | 41 ++++++++ > 6 files changed, 199 insertions(+) > create mode 100644 changelogs/unreleased/gh-5447-downstream-lag.md > create mode 100644 test/replication/gh-5447-downstream-lag.result > create mode 100644 test/replication/gh-5447-downstream-lag.test.lua > > diff --git a/changelogs/unreleased/gh-5447-downstream-lag.md b/changelogs/unreleased/gh-5447-downstream-lag.md > new file mode 100644 > index 000000000..726175c6c > --- /dev/null > +++ b/changelogs/unreleased/gh-5447-downstream-lag.md > @@ -0,0 +1,6 @@ > +#feature/replication > + > + * Introduced `box.info.replication[n].downstream.lag` field to monitor > + state of replication. This member represents time spent between > + transaction been written to initiator's WAL file and reached WAL > + file of a replica (gh-5447). Same here. -- Serge Petrenko