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 748F66EC56; Wed, 14 Jul 2021 21:36:31 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 748F66EC56 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1626287791; bh=MaJbn8lISOfm2kim3PRYnfffKx4lS+2slbXQj1Ehyyo=; 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=BPamPJYBtEn1c76F3F267SYbZisUgwXeMmkJQn7pYJYk//G42y2FhVPjcMM5kcQmT +xvuTFlimUF11tbfZffYRdaksZ6qQhRQNzBHRxzjgD23A213hl7BeqnPqz+mGNFcct lVUw2MoagYwNxBJZb1IaefLvwItr6BqqzhxtdYA4= Received: from smtp54.i.mail.ru (smtp54.i.mail.ru [217.69.128.34]) (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 941566EC56 for ; Wed, 14 Jul 2021 21:28:22 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 941566EC56 Received: by smtp54.i.mail.ru with esmtpa (envelope-from ) id 1m3jcM-0002Nr-04; Wed, 14 Jul 2021 21:28:22 +0300 To: Vladislav Shpilevoy , gorcunov@gmail.com Cc: tarantool-patches@dev.tarantool.org References: <36836518bdd41be84a0c84e32b244093ed069f62.1624918078.git.sergepetrenko@tarantool.org> <31de38b6-570f-b6c3-ebeb-695c21ee9e90@tarantool.org> Message-ID: <3bd07872-aeb4-639c-0bfa-e7e55f3f6792@tarantool.org> Date: Wed, 14 Jul 2021 21:28:21 +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: <31de38b6-570f-b6c3-ebeb-695c21ee9e90@tarantool.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD97BB0EF39AD2B33D52D9CC5C87942E9F174CE6222ED5B65F6182A05F5380850406F25E3F90EAC392F903E8F54047D733FD1E46CD95FC51001D8E324D00FFE9B75 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE757F64E7FD849EB4FEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063786D6A7D810B9582D8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D89FB5CFECA668EED907D6914FF689BE04117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC60CDF180582EB8FBA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352026055571C92BF10F618001F51B5FD3F9D2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B6753C3A5E0A5AB5B7089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: 0D63561A33F958A51871CF16978D0A7F02399E3A4F4C5517E28EDDB469513EE9D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75E1D4179F59451251410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D346AD04FDA812EEFF11CDED0EA4660770F07139012AA7182A9A8BC4A80C1535D6AADDA2AF52522A0EA1D7E09C32AA3244CD472B5E3C0B7FE32A190155122470F297101BF96129E4011FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojDdSFIg49M1R+ZWYqdTpSrw== X-Mailru-Sender: 3B9A0136629DC9125D61937A2360A446144E298974287DF4EDA160E666C0F3D5C4D97666E492C5A0424AE0EB1F3D1D21E2978F233C3FAE6EE63DB1732555E4A8EE80603BA4A5B0BC112434F685709FCF0DA7A0AF5A3A8387 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: Serge Petrenko via Tarantool-patches Reply-To: Serge Petrenko Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" 04.07.2021 15:28, Vladislav Shpilevoy пишет: > 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. Yep, will do. >> 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. Fixed, thanks! >> + 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? I think not. I start using replica's version only in this commit. Why start passing it to relay earlier? -- Serge Petrenko