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 BCCF26EC55; Tue, 27 Jul 2021 02:44:58 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org BCCF26EC55 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1627343098; bh=OJsLpyiMkZnXmm8PebFqJl0BQgHgsuoXpXy3wc0a4Ss=; 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=WEAbGWBXbuuMXcJbuhMoFGkcPWjkkxby7EI/myS6eqO8OWvNGW7oAluDK+ffeV0hd /F0luQVatOgD2BupBu/HUhinGFlDUTXN5WM/fFdFOE96AzLA/FMafCQvf8Z5ULUtMk 1FACBnc93l/DF7hIkPx3LbvYhKoGByE7p/Qlp+Gg= 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 704046EC5E for ; Tue, 27 Jul 2021 02:44:35 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 704046EC5E Received: by smtpng2.m.smailru.net with esmtpa (envelope-from ) id 1m8AGw-0003Ss-Qx; Tue, 27 Jul 2021 02:44:35 +0300 To: Sergey Petrenko , gorcunov@gmail.com Cc: tarantool-patches@dev.tarantool.org References: <5c38c2b4f516ce3777b2f3374f6c76f8e9229448.1626287002.git.sergepetrenko@tarantool.org> Message-ID: <2f678c9a-7065-9fdb-f446-22d67be47399@tarantool.org> Date: Tue, 27 Jul 2021 01:44:33 +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: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD941C43E597735A9C3038391AAE5FBFA7682283CBB09BF492D182A05F538085040F892484D23AAAE8F2B7C08D9DDACDC41337130E12F9E22942465FA9635DBED7B X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE77C1346FE4B18DC51EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637993F4D0876F024C68638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D882D16A1D98E747003B8182BC76EE92C9117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC8C7ADC89C2F0B2A5A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352026055571C92BF10FC26CFBAC0749D213D2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B613439FA09F3DCB32089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A213B5FB47DCBC3458834459D11680B505B043F014BEAB09595C145C1305405D09 X-C1DE0DAB: 0D63561A33F958A5D53CCD7587C14EF8B58931D88E6770AEBB096AA1569AEE6ED59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA753530422897FB34C3410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D3473457D764E1CDE77A77BB2156D8CC13445D0C977382DD34B8E1532A4910D5287B545DD0F00B800C11D7E09C32AA3244C0115A285CEDD352CCB6D27B9DFA1350AF26BFA4C8A6946B8FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojMEANdStWW5847Yr7nTxALw== X-Mailru-Sender: 689FA8AB762F7393C37E3C1AEC41BA5D2CFC467F814B0099310E734EA4D69B113841015FED1DE5223CC9A89AB576DD93FB559BB5D741EB963CF37A108A312F5C27E8A8C3839CE0E267EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v4 09/16] box: split promote() into reasonable parts 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" Thanks for the fixes! > diff --git a/src/box/box.cc b/src/box/box.cc > index 85fac08bb..d83c30918 100644 > --- a/src/box/box.cc > +++ b/src/box/box.cc > @@ -1527,6 +1527,140 @@ box_wait_quorum(uint32_t lead_id, int64_t target_lsn, int quorum, <...> > + > +/** > + * A helper to wait until all limbo entries are ready to be confirmed, i.e. > + * written to WAL and have gathered a quorum of ACKs from replicas. > + * Return lsn of the last limbo entry on success, -1 on error. > + */ > +static int64_t > +box_wait_limbo_acked(void) > +{ > + if (txn_limbo_is_empty(&txn_limbo)) > + return txn_limbo.confirmed_lsn; > + > + uint64_t promote_term = txn_limbo.promote_greatest_term; > + int quorum = replication_synchro_quorum; > + struct txn_limbo_entry *last_entry; > + last_entry = txn_limbo_last_synchro_entry(&txn_limbo); > + /* Wait for the last entries WAL write. */ > + if (last_entry->lsn < 0) { > + int64_t tid = last_entry->txn->id; > + > + if (wal_sync(NULL) < 0) Could you please make it `!= 0`? To be consistent with the other places and to emphasize the result is binary - either an error or success.