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 CCFDC6EC55; Thu, 29 Jul 2021 23:46:42 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org CCFDC6EC55 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1627591602; bh=FpCrzHJuOKNSMruZhE1/uu3W2/Mv6VJiifKl4URGsO4=; h=To:Cc:References:Date:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=Di7RmO2HH6t21NJqHvuDDrMnfVhZng2LrFaGX7jdMOVrU1e8WOjmCer636oaaUhKP XYN+uPtZEiEg9TmdksGIT0agtoP5R45bUEgY6r+5OfUeYK3POcEzodabUq3lrCCS8/ IGKgP5coTXZ+aXu45tvkzUAKUPTM/Pb0qBFgfXS8= Received: from smtp3.mail.ru (smtp3.mail.ru [94.100.179.58]) (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 EC0BA6EC55 for ; Thu, 29 Jul 2021 23:46:41 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org EC0BA6EC55 Received: by smtp3.mail.ru with esmtpa (envelope-from ) id 1m9CvR-0006w5-4a; Thu, 29 Jul 2021 23:46:41 +0300 To: Vladislav Shpilevoy , gorcunov@gmail.com Cc: tarantool-patches@dev.tarantool.org References: <6792924a-e20c-4040-6d5a-8f724ae20981@tarantool.org> Message-ID: Date: Thu, 29 Jul 2021 23:46:40 +0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <6792924a-e20c-4040-6d5a-8f724ae20981@tarantool.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD941C43E597735A9C354866C15C72ED952BE56FFA0EFAF5B8C182A05F5380850400AE4C01160DAF11D6664E1239DDE5CAC4B38E3879A9F0F4D7C41437574ED1868 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE73DDC6BBB7CD71318EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006371DF52D98DC3592C48638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D87368283DDDEFA51D686B8EBE071C3981117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC05EF1B56D39DD5F7389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC8D2AC72D04CD5349BF6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA73AA81AA40904B5D9A18204E546F3947C97F6DC7EE186E49476E601842F6C81A12EF20D2F80756B5F7E9C4E3C761E06A776E601842F6C81A127C277FBC8AE2E8B89C074F960B19C4B3AA81AA40904B5D9DBF02ECDB25306B2201CA6A4E26CD07C3BBE47FD9DD3FB595F5C1EE8F4F765FC72CEEB2601E22B093A03B725D353964B0B7D0EA88DDEDAC722CA9DD8327EE4930A3850AC1BE2E735B58781B77DE60D36C4224003CC83647689D4C264860C145E X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A213B5FB47DCBC3458F0AFF96BAACF4158235E5A14AD4A4A4625E192CAD1D9E79DB53CE84373687089D5FE5466EAF0C656 X-C1DE0DAB: 0D63561A33F958A5CFDD343497465D90A120F24B7140CA57F64D1EE3112F1AEAD59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7536C62C4FBC402878410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34A503FBFE8BE8FC4982E1029D8CDA367A66CFBBE5F44495C8E61325C0D6582B554434819FC737F6011D7E09C32AA3244CCEE70E30E778C12F99FFDB5176AABA95E3D93501275E802FFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojPp/mPgZxawG7gUyBOsVSnw== X-Mailru-Sender: 9482C2B233321BD27EE33DDA534ACD913ABFBD9EEE9F50157DEB2EBD0707A278F143A866344D94096BB2E709EA627F343C7DDD459B58856F0E45BC603594F5A135B915D4279FF0579437F6177E88F7363CDA0F3B3F5B9367 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v4 07/16] replication: send current Raft term in join response 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: Sergey Petrenko via Tarantool-patches Reply-To: Sergey Petrenko Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" 27.07.2021 02:43, Vladislav Shpilevoy пишет: > On 23.07.2021 09:44, Sergey Petrenko wrote: >> 22.07.2021 01:24, Vladislav Shpilevoy пишет: >>> Thanks for the patch! >>> >>>> diff --git a/src/box/relay.cc b/src/box/relay.cc >>>> index 4b102a777..70f1a045b 100644 >>>> --- a/src/box/relay.cc >>>> +++ b/src/box/relay.cc >>>> @@ -451,6 +453,10 @@ relay_initial_join(int fd, uint64_t sync, struct vclock *vclock, >>>>           row.sync = sync; >>>>           coio_write_xrow(&relay->io, &row); >>>>   +        xrow_encode_raft(&row, &fiber()->gc, &raft_req); >>>> +        row.sync = sync; >>>> +        coio_write_xrow(&relay->io, &row); >>> You might need to send it before the limbo checkpoint. Otherwise >>> the problem is exactly the same - the master could send the limbo >>> state, the replica applied it, then the master dies before sending the >>> raft state, then the replica has limbo's term > raft term. >> Yep, thanks for noticing! Fixed. > Hm, but is it really possible? If the initial join is not finished > (the master didn't send data) and only the limbo is delivered, then > the remote instance is going to fail its bootstrap anyway and won't > use the partially received state. That's true. Anyway, let's send raft state and limbo state in correct order, just to keep things consistent. Otherwise we'll have a point in time when limbo term is bigger than raft term. Let's better get rid of such cases completely.