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 F0D1C70200; Sun, 31 Jan 2021 20:43:55 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org F0D1C70200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1612115036; bh=yN66ZKM6eFOn6A96NE75iNl09Bunggqdz4n09Jim/Og=; h=To:References:Date:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=exp/xHpmN7FylYdmNEOONn+QU/Xuehry30cJujBiH/AZv6AxtZOOl55WE6cBG28Nj Hrr3BN/CVR2i5kjNNoVN38KI0OnCTXn7TVglqQ+jyqj1MuN1l/r6P6hTns3OTRto/9 KcQ1wgWQF3lw4cxzgIKWpSawRuTGkFKyCLZKFMtc= Received: from smtpng2.m.smailru.net (smtpng2.m.smailru.net [94.100.179.3]) (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 482E270200 for ; Sun, 31 Jan 2021 20:43:55 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 482E270200 Received: by smtpng2.m.smailru.net with esmtpa (envelope-from ) id 1l6GlO-0000dZ-Pz; Sun, 31 Jan 2021 20:43:55 +0300 To: Cyrill Gorcunov , tml References: <20210121171753.186891-1-gorcunov@gmail.com> <20210121171753.186891-2-gorcunov@gmail.com> Message-ID: <84a18339-3eaf-477a-1bc2-71524c893ca3@tarantool.org> Date: Sun, 31 Jan 2021 18:43:53 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <20210121171753.186891-2-gorcunov@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD953AC099BC0052A9CC9F923E808BA4A11AAD7C69F0036037C182A05F5380850406C4D99383BE0F9E27C9118B79E20BF467C9710882F4E06F351259DB85F920CA9 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE70B8ADF238913687CB287FD4696A6DC2FA8DF7F3B2552694A4E2F5AFA99E116B42401471946AA11AF23F8577A6DFFEA7CED6B9921EE2920938F08D7030A58E5AD6BA297DBC24807EAA9D420A4CFB5DD3EF4EB5DC0AE86B4916AB188092A5C87C4820498A25F97EBA38941B15DA834481FA18204E546F3947C744B801E316CB65FF6B57BC7E64490618DEB871D839B7333395957E7521B51C2DFABB839C843B9C08941B15DA834481F8AA50765F7900637D9CFB327BC390E24389733CBF5DBD5E9B5C8C57E37DE458BD96E472CDF7238E04AD6D5ED66289B5278DA827A17800CE702706FBA1021170467F23339F89546C5A8DF7F3B2552694A6FED454B719173D6725E5C173C3A84C3D27EA2B1546FA1FC35872C767BF85DA2F004C906525384306FED454B719173D6462275124DF8B9C934F12F0C005D1A85E5BFE6E7EFDEDCD789D4C264860C145E X-C1DE0DAB: 0D63561A33F958A5F4EB5DC0AE86B4916AB188092A5C87C440AC7148881962E6D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75448CF9D3A7B2C848410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D342B8615F5CFAD9D02D4C5D701DB1B44D0923AC908D4FD8CB836F41BD99F21A8C19EB934DCD73C81741D7E09C32AA3244C6A3B91B4DA574F5189DFA9740E74EB1F8580396430872480729B2BEF169E0186 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojyKiJYJ15DtLKpA8mVMZbag== X-Mailru-Sender: 689FA8AB762F73936BC43F508A06382228F62B22EB3E3F3FA877D031FC09637C3841015FED1DE5223CC9A89AB576DD93FB559BB5D741EB963CF37A108A312F5C27E8A8C3839CE0E267EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH 1/3] xrow: encode timestamp into vclock message 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: Vladislav Shpilevoy via Tarantool-patches Reply-To: Vladislav Shpilevoy Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" 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 > --- > 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; > } >