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 28E096EC56; Thu, 29 Jul 2021 23:47:14 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 28E096EC56 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1627591634; bh=wSchZ56PaaK0Lb5O77UcTDC66dlrXdUdfvND/sCjQ7Q=; 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=SrG3CF0r3tiFA++d53gYcIBYiEschupfBFEfgctzsxJoLDg6woCjPOcvRtfkIHFDF PL4EVnYWWT3AXjzJ67Wb90DObAMKinN8OVfCigTL/368Q19OTWjnebw83W+/awy8Un rnA6pvEMzGgIowpTAjaey1B3eMWQvsw/DfJqFmp4= Received: from smtp33.i.mail.ru (smtp33.i.mail.ru [94.100.177.93]) (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 C37D16EC5A for ; Thu, 29 Jul 2021 23:46:46 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org C37D16EC5A Received: by smtp33.i.mail.ru with esmtpa (envelope-from ) id 1m9CvW-0003ca-6q; Thu, 29 Jul 2021 23:46:46 +0300 To: Vladislav Shpilevoy , gorcunov@gmail.com Cc: tarantool-patches@dev.tarantool.org References: <5c38c2b4f516ce3777b2f3374f6c76f8e9229448.1626287002.git.sergepetrenko@tarantool.org> <2f678c9a-7065-9fdb-f446-22d67be47399@tarantool.org> Message-ID: Date: Thu, 29 Jul 2021 23:46:45 +0300 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: <2f678c9a-7065-9fdb-f446-22d67be47399@tarantool.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD941C43E597735A9C351B198F4576AC7B2770D7874BA03B4AE182A05F53808504004C08775AA9091E30E3535C6733EBFE89538C492AF042A56EC92AD050FD787CC X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7678D195E6F08FCA2EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637369CDFF96C7994428638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D84DE65E4EF50163464E7F4E6D113BE789117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC974A882099E279BDA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352026055571C92BF10FCB629EEF1311BF91D2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EE7B96B19DC40933213071BDA2D7A0BB39D8FC6C240DEA7642DBF02ECDB25306B2B78CF848AE20165D0A6AB1C7CE11FEE3A6C7FFFE744CA7FB2D242C3BD2E3F4C6C4224003CC836476EA7A3FFF5B025636E2021AF6380DFAD1A18204E546F3947CB11811A4A51E3B096D1867E19FE1407959CC434672EE6371089D37D7C0E48F6C8AA50765F790063788B3B24285A3CD0EEFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A213B5FB47DCBC3458F0AFF96BAACF4158235E5A14AD4A4A4625E192CAD1D9E79DB53CE8437368708997EBE292AE1C5588 X-C1DE0DAB: 0D63561A33F958A55565083B5F2B29A4D569273FBF15B6EBC59DECC21CAE366CD59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7536C62C4FBC402878410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D348F1757F8DFBC5C338C5608121A2936C639921F9B623FE614FE871B2905B04122DF90338A67D25DB31D7E09C32AA3244C6455DA66930B556B0A7D92BABF79CC92435BF7150578642FFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojPp/mPgZxawFr1CCnziGZ2Q== X-Mailru-Sender: 9482C2B233321BD27EE33DDA534ACD918D1F83CE44F8F208C3F22B9320AFCD480E3C4D52190A090A6BB2E709EA627F343C7DDD459B58856F0E45BC603594F5A135B915D4279FF0579437F6177E88F7363CDA0F3B3F5B9367 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: Sergey Petrenko via Tarantool-patches Reply-To: Sergey Petrenko Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" 27.07.2021 02:44, Vladislav Shpilevoy пишет: > 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. Sure, fixed. I didn't touch it at first because it had "< 0" even before my patchset.