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 3EA506EC55; Thu, 29 Jul 2021 01:07:59 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 3EA506EC55 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1627510079; bh=PdkCVepeR0lBh7XPVJPVugQgvjmBJTkAh7nxhcLGrMo=; 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=DB9ZOWeB/6Ytmo7UvwHtAsCXp1C8TWNBi1tyH96QSjJVRatcfsk8NZOvf4Vxq9cOI 80QgMjjwxjq03naLJi3zQH54/2rBvWrqOfEBoKIqmgCRdOf/sJubjqNFZum4DBKxl5 j/WUIdw7iO4NuNCoiYMfJQLtKcH8xxJFOzW7WBhs= Received: from smtpng2.i.mail.ru (smtpng2.i.mail.ru [94.100.179.3]) (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 0C3546EC55 for ; Thu, 29 Jul 2021 01:07:46 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 0C3546EC55 Received: by smtpng2.m.smailru.net with esmtpa (envelope-from ) id 1m8riL-0001Pn-GA; Thu, 29 Jul 2021 01:07:45 +0300 To: Cyrill Gorcunov Cc: tml References: <20210726153452.113897-1-gorcunov@gmail.com> <20210726153452.113897-4-gorcunov@gmail.com> <3a64d0ce-b2aa-d331-942e-b60484638dd9@tarantool.org> Message-ID: <5f0235c4-628c-f29b-097a-48f7203320cd@tarantool.org> Date: Thu, 29 Jul 2021 00:07:44 +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 Content-Language: en-US Content-Transfer-Encoding: 7bit X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD941C43E597735A9C351B198F4576AC7B21928AAE70459C21B182A05F53808504037FAF93EA08092CC7E5511AE972B64C1A3F01AFD680E67434B27EA0EFA14B1F6 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7A1DB0B089319D380EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637995C329E4A8C93938638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8204BF3912C734B21C2C8A0385739EEEC117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC292D688DDAD4E7BC389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC87BD21ED50D08CA4DF6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA7E827F84554CEF5019E625A9149C048EE9ECD01F8117BC8BEE2021AF6380DFAD18AA50765F790063735872C767BF85DA227C277FBC8AE2E8B08F9A42B2210255C75ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A213B5FB47DCBC3458834459D11680B5056A013C53F122F03230FE7B153D5B4170 X-C1DE0DAB: 0D63561A33F958A53A4B49C81E7AAE9592E60AAEE4B30A148A74C3587A24F1D9D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA754263BA4E959D734C410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D342C0B628602DFD0BC5ACDC736D2D719B6B9C3BA3AC94442C8A14055904423B34DE9D7D37D1BFF37061D7E09C32AA3244C2FB2808F72B3F2BD6CFE562A9CEA377DA90944CA99CF22E3729B2BEF169E0186 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojPp/mPgZxawG9i3Pkb5CePg== X-Mailru-Sender: 689FA8AB762F7393C37E3C1AEC41BA5D89480E488CC7C99162106A88E55208753841015FED1DE5223CC9A89AB576DD93FB559BB5D741EB963CF37A108A312F5C27E8A8C3839CE0E267EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v8 3/6] limbo: gather promote tracking into a separate structure 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" On 28.07.2021 23:57, Cyrill Gorcunov wrote: > On Wed, Jul 28, 2021 at 11:34:43PM +0200, Vladislav Shpilevoy wrote: >> Hi! Thanks for the patch! >> >> On 26.07.2021 17:34, Cyrill Gorcunov via Tarantool-patches wrote: >>> It is needed to introduce ordered promote related data >>> modifications in next patch. >> >> Why do you need this new struct? While I like the new names >> (the old promote_greatest_term was super long), I don't see >> any motivation to extract the members into a new struct. >> It is still used only inside of the limbo as a member. >> >> I suppose this might be a leftover from the old versions of >> the patchset. Please, try to keep these members inside of >> the limbo like they were. > > The key moment here is the locking we use for terms tracking, > note the locking is not covering the whole limbo thus better > to keep the lock itself inside the structure it protects I think. Yes, the struct it protects is the limbo. Part of. I see no sense to extract the members you protect into a new struct just because only they are protected. Take cbus_endpoint for instance. It has a mutex, and it is locked to push/pop new messages into a queue. It is taken to touch the queue. But it does not mean you need struct cbus_endpoint_queue for that. The struct you created is very artificial, it has no purpose outside of the limbo and there can't be multiple of these structs. Which makes it pointless. It only complicates the patch. It has no its own methods except 'create()', has no 'destroy()', all its access goes through txn_limbo methods, even the lock is stored in the limbo, not in this struct, which contradicts with what you said above.