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 EE19C6EC55; Fri, 23 Jul 2021 10:45:40 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org EE19C6EC55 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1627026341; bh=b3SyU0FGFsGYyZxdwW8RnVltAdG9w17mZJvC/rhYtUQ=; 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=DJz649NeTZAw70oIAyPQ6H/Y4jxLb0oR4UZjlZ2VDB30NSw2TsNiulU9fpi3D80V0 L/Aub4rit0zqfJiKERTyyiQxt48xANuejnjflimud8qFV6usiwR4WmXKeg+n6fpTuo A/+OCl7fIErGypq+gP7sFZpO/DRQlRguOXmSw7rA= Received: from smtp44.i.mail.ru (smtp44.i.mail.ru [94.100.177.104]) (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 2CA446EC56 for ; Fri, 23 Jul 2021 10:45:00 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 2CA446EC56 Received: by smtp44.i.mail.ru with esmtpa (envelope-from ) id 1m6prf-0007BS-Iw; Fri, 23 Jul 2021 10:44:59 +0300 To: Vladislav Shpilevoy , gorcunov@gmail.com Cc: tarantool-patches@dev.tarantool.org References: Message-ID: Date: Fri, 23 Jul 2021 09:44:58 +0200 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: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD941C43E597735A9C320FB367CC9CBEE800EEBD3117ABA9A5B182A05F5380850403312F68059934A7CD7DCF47EE2461FE698914AF8C5B6A1EA5F5E9D257EA1DA53 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE76574C3D62D66A535EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637CF19945FAF91394A8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8E2D864C2F9E8E952D2F994F16C3F0851117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC566404C906FA8ADEA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F44604297287769387670735209647ADFADE5905B1F6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA73AA81AA40904B5D9A18204E546F3947C8AC305E826530DEC6E0066C2D8992A164AD6D5ED66289B52698AB9A7B718F8C46E0066C2D8992A16725E5C173C3A84C34979D717CB766E07BA3038C0950A5D36B5C8C57E37DE458B0BC6067A898B09E46D1867E19FE14079C09775C1D3CA48CF3D321E7403792E342EB15956EA79C166A417C69337E82CC275ECD9A6C639B01B78DA827A17800CE7994FE22CF3C16DE0731C566533BA786AA5CC5B56E945C8DA X-C1DE0DAB: 0D63561A33F958A5E87658C2BEB694AEE37B86D27EE560D60388D17B0CCB38ABD59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7501A9DF589746230F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D344EF254DC71474AA3425576E65C4FE2BC9BA6F0B4D9BBFC6F0C802227ABC2A43E6070B27AB3B096AC1D7E09C32AA3244C8F498ED1E00087CDEE35C15C1FDA703BE8FBBEFAE1C4874CFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojtKXY6NTIXk2RVsAF/eg4Dw== X-Mailru-Sender: 9482C2B233321BD2827D960CA7C4D2E27660F66556D1260E0DF9AE4DD726A33A7911CFD4E9CEF1106BB2E709EA627F343C7DDD459B58856F0E45BC603594F5A135B915D4279FF0579437F6177E88F7363CDA0F3B3F5B9367 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" 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. =============================== diff --git a/src/box/relay.cc b/src/box/relay.cc index b413b713c..805b5e7ff 100644 --- a/src/box/relay.cc +++ b/src/box/relay.cc @@ -447,15 +447,14 @@ relay_initial_join(int fd, uint64_t sync, struct vclock *vclock,                 row.type = IPROTO_JOIN_META;                 coio_write_xrow(&relay->io, &row); +               xrow_encode_raft(&row, &fiber()->gc, &raft_req); +               coio_write_xrow(&relay->io, &row); +                 char body[XROW_SYNCHRO_BODY_LEN_MAX];                 xrow_encode_synchro(&row, body, &req);                 row.replica_id = req.replica_id;                 coio_write_xrow(&relay->io, &row); -               xrow_encode_raft(&row, &fiber()->gc, &raft_req); -               row.sync = sync; -               coio_write_xrow(&relay->io, &row); -                 /* Mark the end of the metadata stream. */                 row.type = IPROTO_JOIN_SNAPSHOT;                 coio_write_xrow(&relay->io, &row); =============================== > I wish we could test it somehow simple.