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 F348A6ECE3; Fri, 14 Jan 2022 02:32:08 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org F348A6ECE3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1642116729; bh=aKUAlgvF/fzrFw8wIccmZw9iYCnIGiXAYUWVfuR5SXQ=; h=Date:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=fTbRnypF4pcl95ELkhCKhQ5QiqqhQ39OqRo90c+iyr2gA5P0yWXRObzflxJFtoshO 4c8eqM60qslzfdpo3XjK+YkIelWMV7NuICoX90oRo/KxRyzInrAvJvah2McygGBa1t saX21Vwolm4U5ilArmqQxe1QKpTMVvFntzsAbDzk= 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 3E44E6ECE3 for ; Fri, 14 Jan 2022 02:32:06 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 3E44E6ECE3 Received: by smtpng1.m.smailru.net with esmtpa (envelope-from ) id 1n89Zd-0002F5-Ei; Fri, 14 Jan 2022 02:32:05 +0300 Message-ID: <1e296ade-8121-4ba3-7762-5695729544c3@tarantool.org> Date: Fri, 14 Jan 2022 00:32:04 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Content-Language: en-US To: Serge Petrenko , Cyrill Gorcunov Cc: tml References: <20211230202347.353494-1-gorcunov@gmail.com> <20211230202347.353494-3-gorcunov@gmail.com> <1641824923.419591282@f764.i.mail.ru> <77b533c1-0c2f-c11d-0aa6-4109674a7025@tarantool.org> <63f0bdcc-4ab1-6fa9-411f-ddce6e0aa215@tarantool.org> <5cc5a52d-e6a7-b4cc-d2a1-23a9b1758288@tarantool.org> In-Reply-To: <5cc5a52d-e6a7-b4cc-d2a1-23a9b1758288@tarantool.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-4EC0790: 10 X-7564579A: EEAE043A70213CC8 X-77F55803: 4F1203BC0FB41BD95EF659BF0AF1B9AECEEE4BDB381542F442F164F004C6041E182A05F5380850404C228DA9ACA6FE2745E23E3ED3BC34ED8200CD8360FBDE164676809686FE7399DEDF32025193304E X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7A20935EE237A17ECEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637A6C16C7015BEC7F48638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D84CD995AB11F201E0E52B477589D3D589117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC60CDF180582EB8FBA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F44604297287769387670735201E561CDFBCA1751F28451B159A507268D2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B62CFFCC7B69C47339089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: 0D63561A33F958A5AC025E2A511E1E0CAF032D5C3F783CA4D1842BA68597138CD59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA754D8E939D8DBE9AFC410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34E54F8089C01448AA0822DA35C410CD37E2256E74E479B771B5E802DDB1194188A98362AC3EF006CE1D7E09C32AA3244C955BC203CDF3EB5E3532C18B554FE0C939C99C45E8D137E9FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojieoUMt/u5LhTcOWSkCyEqA== X-Mailru-Sender: 689FA8AB762F739339CABD9B3CA9A7D6DA9172949044619269C425CE4BFF75563841015FED1DE5223CC9A89AB576DD93FB559BB5D741EB963CF37A108A312F5C27E8A8C3839CE0E25FEEDEB644C299C0ED14614B50AE0675 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v27 2/3] qsync: order access to the limbo terms 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 13.01.2022 11:13, Serge Petrenko wrote: > > > 13.01.2022 00:30, Vladislav Shpilevoy пишет: >> Hi! >> >> On 12.01.2022 15:01, Serge Petrenko wrote: >>> >>> 11.01.2022 23:39, Cyrill Gorcunov пишет: >>>> On Mon, Jan 10, 2022 at 05:28:43PM +0300, Serge Petrenko wrote: >>>>>      Hi! Thanks for the patch! >>>>>           box_issue_promote() and box_issue_demote() need fine-grained locking >>>>>      anyway. >>>>>      Otherwise it’s possible that promote() is already issued, but not yet >>>>>      written to WAL, and some >>>>>      outdated request is applied by applier at that exact moment. >>>> True. And in previous series Vlad has asked to not move in code which is >>>> not covered by tests. So I think this is a task for the next part. Currently >>>> we cover only the race between appliers. >>> Let's ask Vlad, then. >>> >>> I feel like we should fix this now, not waiting for a full fine-grained locking >>> patch. >>> >>> First of all, this is a known bug (and fine-grained locking was meant to >>> cover everything we don't know of, just in case). >> I am not sure I understand what you both are talking about here. Sergey, do >> you mean 'fine-grained locking' as big critical sections covering a lot of >> code at once or as many small critical sections? > > I mean "locking every limbo function", like Cyrill tried to do that in the > previous patch version. Давай по-русски, тут какое-то недопонимание. В старых версиях Кирилл пытался лочить слишком мелко. Протестировать такое было тяжеловато. Потому та версия не зашла - тестов было 0. >> I am confused because of this sentence. "Cover everything we don't know" is >> rather opposite to fine-grained locking. I voted for big locks because >> apparently it was too hard to implement smaller more precise locks. >> >>> Besides, simply locking issue_promote/issue_demote should be >>> much easier than implementing the fine-grained locking patch. >> Yes. I remember the proposal was to lock entire promote/demote and other >> qsync/raft functions from beginning to end. Because it should be relatively >> easy. I didn't look at the code in this patch though, can't comment it. > > This particular patch only locks applier_apply_synchro_request(), txn_limbo_process() > and txn_limbo_is_replica_outdated(), so that applier cannot apply a request from an > already stale term. > > My proposal is to lock box_issue_promote() and box_issue_demote() > (not whole promote/demote) to get rid of another race: when promote is written > to WAL, but not yed processed. Почему не лочить целиком promote/demote? Может если локи были бы шире, то не нужно было бы и на триггеры портировать все как в новом тикете? > What you're talking about is what I call "fine grained locking", and it turned > out rather hard to implement, so Cyrill abandoned this idea for now. fine grained значит "мелко-зернистый". То есть локи были бы на мелкие куски кода, как сначала Кирилл пытался сделать. Я как раз за наоборот топлю - блокировать сразу большие куски, а не "мелко".