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 815896EC40; Sun, 4 Jul 2021 15:28:33 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 815896EC40 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1625401713; bh=S0Efo4liUFgRvsryApu2gmRPUwEvr1S2Na3ozo9Q0GI=; 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=c20xVMXhASKAYYZly3U+8oSpzuOUqvkLiowX7QQXWS3NpO3gaQXn8q12yZEsuMZ/2 Ita5Lk+KEsgBtvyI6AUgduLHM4C9greY1HciiwhJNss5UXyfP8VY+OedWW9T86llfM t+3bmWN4l9H82QQj+h/3ULNqG9hIZKFM3TwsiYWc= Received: from smtpng1.i.mail.ru (smtpng1.i.mail.ru [94.100.181.251]) (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 940886EC40 for ; Sun, 4 Jul 2021 15:28:31 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 940886EC40 Received: by smtpng1.m.smailru.net with esmtpa (envelope-from ) id 1m01Ec-00031m-Rp; Sun, 04 Jul 2021 15:28:31 +0300 To: Serge Petrenko , gorcunov@gmail.com Cc: tarantool-patches@dev.tarantool.org References: <36836518bdd41be84a0c84e32b244093ed069f62.1624918078.git.sergepetrenko@tarantool.org> Message-ID: <31de38b6-570f-b6c3-ebeb-695c21ee9e90@tarantool.org> Date: Sun, 4 Jul 2021 14:28:29 +0200 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: <36836518bdd41be84a0c84e32b244093ed069f62.1624918078.git.sergepetrenko@tarantool.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD954DFF1DC42D673FB2F1AA0EB8A504C8721532AB396CDCF09182A05F538085040955A49135E3D761C154807D280BA9BF0E6D93F8665A9A98B40622B988C467E47 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE77C1346FE4B18DC51EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637CD1DFD3ABA64F6568638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8E6CDD9326012DF620E4C63308878305F117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC292D688DDAD4E7BC389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC81F9513A7CA91E555F6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA7E827F84554CEF5019E625A9149C048EE9ECD01F8117BC8BEE2021AF6380DFAD18AA50765F790063735872C767BF85DA227C277FBC8AE2E8B851EDB9C5A93305EEFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-C1DE0DAB: 0D63561A33F958A58130A639F0772A5B21B44640735E88C4E0277EBCF211D665D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75F95D039699DA79E9410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34D75CEA0D7A80616EDC9017E47760EE6CA5F7DFC5256D77B6A772B71095CCD40207E629D4755C24111D7E09C32AA3244CE42A384F3546ADCF7576D45DFAC384658894E9C85370243EFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj5fH2RN9TpJkcSn4yEJWtJA== X-Mailru-Sender: 689FA8AB762F7393C37E3C1AEC41BA5D975519354FDDE8871218FC17791371C53841015FED1DE5223CC9A89AB576DD93FB559BB5D741EB963CF37A108A312F5C27E8A8C3839CE0E267EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v3 10/12] replication: add META stage to JOIN 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" Thanks for the patch! See 3 comments below. On 29.06.2021 00:12, Serge Petrenko via Tarantool-patches wrote: > The new META stage is part of server's response to a join request. > It's marked by IPROTO_JOIN_META and IPROTO_JOIN_SNAPSHOT requests and goes > before the actual snapshot data. > > Follow-up #6034 1. You probably should document the new keys and their meaning. As well as what is sent between them. > diff --git a/src/box/applier.cc b/src/box/applier.cc > index 07fe7f5c7..7abad3a64 100644 > --- a/src/box/applier.cc > +++ b/src/box/applier.cc > @@ -447,12 +447,26 @@ applier_wait_snapshot(struct applier *applier) > xrow_decode_vclock_xc(&row, &replicaset.vclock); > } > > + coio_read_xrow(coio, ibuf, &row); > + if (row.type == IPROTO_JOIN_META) { > + /* Read additional metadata. Empty at the moment. */ > + do { > + coio_read_xrow(coio, ibuf, &row); > + if (iproto_type_is_error(row.type)) > + xrow_decode_error_xc(&row); > + else if (row.type != IPROTO_JOIN_SNAPSHOT) { 2. If one branch of `if` got {}, then all branches should get it too. > + tnt_raise(ClientError, ER_UNKNOWN_REQUEST_TYPE, > + (uint32_t)row.type); > + } > + } while (row.type != IPROTO_JOIN_SNAPSHOT); > + coio_read_xrow(coio, ibuf, &row); > + } > diff --git a/src/box/box.cc b/src/box/box.cc > index b2c52bc54..bc68ee4c8 100644 > --- a/src/box/box.cc > +++ b/src/box/box.cc > @@ -2501,7 +2501,7 @@ box_process_fetch_snapshot(struct ev_io *io, struct xrow_header *header) > > /* Send the snapshot data to the instance. */ > struct vclock start_vclock; > - relay_initial_join(io->fd, header->sync, &start_vclock); > + relay_initial_join(io->fd, header->sync, &start_vclock, 0); > say_info("read-view sent."); > > /* Remember master's vclock after the last request */ > @@ -2699,7 +2699,8 @@ box_process_join(struct ev_io *io, struct xrow_header *header) > * Initial stream: feed replica with dirty data from engines. > */ > struct vclock start_vclock; > - relay_initial_join(io->fd, header->sync, &start_vclock); > + relay_initial_join(io->fd, header->sync, &start_vclock, > + replica_version_id); 3. Shouldn't changes to this file be in the previous commit?