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 128FB6FC86; Mon, 22 Mar 2021 12:05:39 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 128FB6FC86 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1616403939; bh=p7PaX9Z41t5YDm6pyWZPH9V+uDgoxP4OdZa099blUPc=; 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=NHOUf6SuzfGLNboUkscOBLdLnJzdTDGf/73BM0HvDyc5U7Bx4g5TIlyaNbkeUbkOF U5rGa6iMl17aZHrfTv3glkzasyZfxRXzs0ZJ07pwxjg6zObUd0pRq8yeSYS46u/Ba+ w6QYKbucGyyV6ab5wIQ/N3obCQat3FDlEDYMSrDQ= Received: from smtp53.i.mail.ru (smtp53.i.mail.ru [94.100.177.113]) (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 802D56FC86 for ; Mon, 22 Mar 2021 12:05:37 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 802D56FC86 Received: by smtp53.i.mail.ru with esmtpa (envelope-from ) id 1lOGVE-0001HL-AO; Mon, 22 Mar 2021 12:05:36 +0300 To: Vladislav Shpilevoy , Cyrill Gorcunov References: <20210318184138.1077807-1-gorcunov@gmail.com> <20210318184138.1077807-2-gorcunov@gmail.com> <42ef5aa6-c491-9930-8f14-f848adb236eb@tarantool.org> Message-ID: Date: Mon, 22 Mar 2021 12:05:35 +0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <42ef5aa6-c491-9930-8f14-f848adb236eb@tarantool.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD95D6E7CC48CB1F5F146FB1591D6F88157B67AD80B9C5634CD182A05F5380850408664615AA4F1D54B2BDEC909533655321615964FE01179B64158DF5A0B1AA703 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE76ABD3380F320B62CEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006378B6D775AC58C227F8638F802B75D45FF914D58D5BE9E6BC131B5C99E7648C95C686AF563A045C75E851E1A02DB9D0617622410B4D74771BEA471835C12D1D9774AD6D5ED66289B5278DA827A17800CE7ABB305BD10C6E5099FA2833FD35BB23D2EF20D2F80756B5F868A13BD56FB6657A471835C12D1D977725E5C173C3A84C301200A96CB7104FF117882F4460429728AD0CFFFB425014E868A13BD56FB6657D81D268191BDAD3DC09775C1D3CA48CFA3970D185F4E8DCCBA3038C0950A5D36C8A9BA7A39EFB766EC990983EF5C0329BA3038C0950A5D36D5E8D9A59859A8B6761C58939FBBE8F976E601842F6C81A1F004C90652538430CDED94BCBF13EF3B93EC92FD9297F6718AA50765F790063798DEE0EE6F24F387A7F4EDE966BC389F395957E7521B51C24C7702A67D5C33162DBA43225CD8A89F249797B4B1AC144942539A7722CA490CB5C8C57E37DE458B4C7702A67D5C3316FA3894348FB808DB48C21F01D89DB561574AF45C6390F7469DAA53EE0834AAEE X-C1DE0DAB: 0D63561A33F958A5267DB789749EF4662ABE6DB38875A1EBC4A16B8BC2DF6397D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7502E6951B79FF9A3F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34F1ADD4D8CD3C81CE509D72427C50D0D467CFAC69BB3CE82CDED2A5C31DDB65F30CE1207E3FA04B0E1D7E09C32AA3244CF5A5B15E8D15C5C2BA0ECB272666F2A764EE5813BBCA3A9D8D5DD81C2BAB7D1D X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojWJZv20R+6UhY7Nif6DQzDw== X-Mailru-Sender: 583F1D7ACE8F49BDD2846D59FC20E9F8000D7915E0058BEE8F0574150AB100CBE0A06BEC388674E4424AE0EB1F3D1D21E2978F233C3FAE6EE63DB1732555E4A8EE80603BA4A5B0BC112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH 1/2] gc/xlog: delay xlog cleanup until relays are subscribed 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 Cc: Mons Anderson , tml Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" 20.03.2021 01:17, Vladislav Shpilevoy пишет: > But what I don't understand now - how does it work if the struct > replica objects create the consumer objects right in replica_set_id()? > > Look at relay_subscribe(). If the replica is not anon, then > 'replica->id != REPLICA_ID_NIL' is true (because there is an assertion). > It means replica_set_id() was already called. And this means replica->gc > is already not NULL. Therefore the check "replica->gc == NULL && !replica->anon" > is never true. Am I missing something? replica_set_id() only sets a gc consumer for a previously anonymous replica, which has just registered. This is not needed at all, likely. Because box_process_register() already creates a gc consumer. And replaces replica's gc consumer, if any, with this freshly created one later. So this piece of code in replica_set_id() is extraneous. It only  makes sense when an anonymous replica was connected to some instance, then it registers on another instance and the first instance receives anonymous replica's _cluster registration via replication. This is still unneeded. Because once previously anonymous replica resubscribes, it'll get a gc consumer like everyone else does. This is quite misleading, indeed. It took me a while to understand what's happening. I'll probably return with a patch removing this piece in replica_set_id() altogether. -- Serge Petrenko