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 9CCB56EC5B; Sat, 29 May 2021 01:20:49 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 9CCB56EC5B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1622240449; bh=/bney9YWsthYIqZq315WtNXxhZp1RMVYo9cHy4FbLyA=; h=To:References:Date:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=YnJWuBMfB2ZQ9Q4KH5//Z30gMlgMFzKrf3VZVNzqnJMW4tRdcMhkKgkldcbGWNodN d/f5jH8COOrbeGY/6gj37zOODJeOTndJAaMGuiYehT/oVh0Sw+qRNyKT/VK5Hnb0+/ ZnLQEo4Qn4svg1dArW80/z6qODWOmaSoJRO8jmZ4= Received: from smtp48.i.mail.ru (smtp48.i.mail.ru [94.100.177.108]) (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 65B226EC5B for ; Sat, 29 May 2021 01:20:48 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 65B226EC5B Received: by smtp48.i.mail.ru with esmtpa (envelope-from ) id 1lmkqV-00019o-NL; Sat, 29 May 2021 01:20:48 +0300 To: Cyrill Gorcunov References: <6ed9245f407510ad3a149f62c960f89fa689909e.1622233728.git.v.shpilevoy@tarantool.org> Message-ID: <705ae468-7849-7928-94ff-0ecefa6fdc07@tarantool.org> Date: Sat, 29 May 2021 00:20:46 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD9157EECD0FDB90B9A3828624E6E8B1F07482114E64581541200894C459B0CD1B9AE172F9DB2C46B5BDBB9E560CF99B0C52E80B474050FF51F29B867418450F35B X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE75C385DEB91CEC222EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637D8F5094E9BAC3E9F8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8C51FA4BC8B2D85A19CBA3C0A6561F194117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC8C7ADC89C2F0B2A5A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352033AC447995A7AD18BDFBBEFFF4125B51D2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EE7B96B19DC4093321D7C2347B1D03E769D8FC6C240DEA7642DBF02ECDB25306B2B78CF848AE20165D0A6AB1C7CE11FEE3CF7CD7A0D5AA5F25BA3038C0950A5D36B5C8C57E37DE458B0BC6067A898B09E46D1867E19FE14079C09775C1D3CA48CF3D321E7403792E342EB15956EA79C166A417C69337E82CC275ECD9A6C639B01B78DA827A17800CE74ABCC139FF3F849B731C566533BA786AA5CC5B56E945C8DA X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A2368A440D3B0F6089093C9A16E5BC824A2A04A2ABAA09D25379311020FFC8D4AD12E71DD4B092D82AFE065FAAD83E644F X-C1DE0DAB: 0D63561A33F958A5169403874F5AC3FCC2A43F23C8A24CCC4EECFE9CDCF99457D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA755C623DA9A0966939410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34F1ADD4D8CD3C81CEAF1E2663AFF75E02A1B22C4BD6D954303154BB9854A93F56BE3A67701F306C261D7E09C32AA3244C2651233FEC0025C4E87938B88F848AD324AF4FAF06DA24FDFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojrzEAfVgW/753jGQ/unMGQQ== X-Mailru-Sender: 504CC1E875BF3E7D9BC0E5172ADA311090676A40B989260BCF744AE9D936698B332C412ACEE59CE607784C02288277CA03E0582D3806FB6A5317862B1921BA260ED6CFD6382C13A6112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH 1/1] replication: check rs uuid on subscribe process 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 Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" On 29.05.2021 00:06, Cyrill Gorcunov wrote: > On Fri, May 28, 2021 at 10:35:42PM +0200, Vladislav Shpilevoy wrote: >> + if (!tt_uuid_is_equal(&peer_replicaset_uuid, &REPLICASET_UUID)) { >> + tnt_raise(ClientError, ER_REPLICASET_UUID_MISMATCH, >> + tt_uuid_str(&REPLICASET_UUID), >> + tt_uuid_str(&peer_replicaset_uuid)); >> + } > > Vlad, I didn't dive into the patch context yet but this > use of *two* sequential calls of tt_uuid_str() is somehow > suspicious. The tt_uuid_str uses single common buffer > for any call which means some of tt_uuid_str() result > will be overwritten, no? Nope, the static buffer is cyclic. Each tt_uuid_str() call uses only a part of it. In total it is safe to make ~12 tt_uuid_str() calls in a row. Because the static buffer size is 12KB, and one tt_uuid_str() wastes 1KB (which is not necessary, it could be much more compact).