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 6AB5A6EC5D; Sat, 3 Apr 2021 16:18:50 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 6AB5A6EC5D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1617455930; bh=ffe0FBfPLDKB3iM2SmAgQpAvpQeKketaIFl4vChqGuU=; h=To:References:Date:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=Cb+BFzminv4FZU58qF/AN7AZlAdJDX+vu+DhfdUBp0a+Ko9AbuqgzdA0Q83OwP92T mmWEj/N7BEOwLDdGMQhUYO6jTDUz7bOQRNg4D2F77y1yi0LnAZdm2Ypfopdk+rX5h7 g++rJ6jN8646XIjl7O5mBP8OmY7e6wIwRlD2gFus= Received: from smtpng1.m.smailru.net (smtpng1.m.smailru.net [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 94E5C6EC5D for ; Sat, 3 Apr 2021 16:18:19 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 94E5C6EC5D Received: by smtpng1.m.smailru.net with esmtpa (envelope-from ) id 1lSgAM-0006Gh-JR; Sat, 03 Apr 2021 16:18:18 +0300 To: Serge Petrenko , tarantool-patches@dev.tarantool.org, gorcunov@gmail.com, korablev@tarantool.org References: <399ad30c78b2767cc6fe14e0f3b42045e0334216.1617315744.git.v.shpilevoy@tarantool.org> <87bd277d-f396-5354-b472-3c3ceecc8c4b@tarantool.org> Message-ID: Date: Sat, 3 Apr 2021 15:18:17 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: <87bd277d-f396-5354-b472-3c3ceecc8c4b@tarantool.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9ED7173E37F4E3294DD38BE31D7797EF84C856624A09E4809182A05F5380850403A696248DDF67885A6D853E96CCF6BDE5E7CB6B6562F73048653599236E8BD44 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE76042E2DB3E33BF2BEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063729381D024F10DD158638F802B75D45FF914D58D5BE9E6BC131B5C99E7648C95C7B5A45DDF210A4CFA6FCDEA782BD79AAFAB5743964A19255A471835C12D1D9774AD6D5ED66289B5278DA827A17800CE77A825AB47F0FC8649FA2833FD35BB23D2EF20D2F80756B5F868A13BD56FB6657A471835C12D1D977725E5C173C3A84C3253F27DA5A70FAF3117882F4460429728AD0CFFFB425014E868A13BD56FB6657E2021AF6380DFAD1A18204E546F3947CB11811A4A51E3B096D1867E19FE1407959CC434672EE6371089D37D7C0E48F6C8AA50765F7900637B5EAED125435346EEFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-C1DE0DAB: 0D63561A33F958A56C1004E7636AB894493542201B973EE3DF50A22460930DE5D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7502E6951B79FF9A3F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D340A4C04F5DECA7EE99B0FA74D99364CBB6F098A4ED4A3E5B1395A3C398195C93756235D2ACC10611C1D7E09C32AA3244C12A071E810745B5F197118110C48E1F6A95CA90A1D8AC565927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojB918AwkVmI17LKM3Pv3MIg== X-Mailru-Sender: 689FA8AB762F73936BC43F508A063822A681D1E13EF08DC3E7AC7CF23ECCD5E13841015FED1DE5223CC9A89AB576DD93FB559BB5D741EB963CF37A108A312F5C27E8A8C3839CE0E267EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH 3/3] box: remove is_local_recovery variable 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 review! >> @@ -253,12 +250,7 @@ box_process_rw(struct request *request, struct space *space, >>            * all during local recovery, since journal_write >>            * is faked at this stage and returns immediately. >>            */ > > The comment above doesn't belong here anymore. > I propose you move it to `wal_stream_apply_dml_row`, where txn_commit_try_async() > is called now. Yeah, I totally forgot about this comment. Moved to try_async in recovery in the previous commit. The full patch: ==================== diff --git a/src/box/box.cc b/src/box/box.cc index 67b44c053..fa8a254f9 100644 --- a/src/box/box.cc +++ b/src/box/box.cc @@ -125,8 +125,6 @@ static struct gc_checkpoint_ref backup_gc; static bool is_box_configured = false; static bool is_ro = true; static fiber_cond ro_cond; -/** Set to true during recovery from local files. */ -static bool is_local_recovery = false; /** * The following flag is set if the instance failed to @@ -241,24 +239,7 @@ box_process_rw(struct request *request, struct space *space, goto rollback; if (is_autocommit) { - int res = 0; - /* - * During local recovery the commit procedure - * should be async, otherwise the only fiber - * processing recovery will get stuck on the first - * synchronous tx it meets until confirm timeout - * is reached and the tx is rolled back, yielding - * an error. - * Moreover, txn_commit_try_async() doesn't hurt at - * all during local recovery, since journal_write - * is faked at this stage and returns immediately. - */ - if (is_local_recovery) { - res = txn_commit_try_async(txn); - } else { - res = txn_commit(txn); - } - if (res < 0) + if (txn_commit(txn) < 0) goto error; fiber_gc(); } @@ -3068,7 +3049,6 @@ local_recovery(const struct tt_uuid *instance_uuid, memtx = (struct memtx_engine *)engine_by_name("memtx"); assert(memtx != NULL); - is_local_recovery = true; recovery_journal_create(&recovery->vclock); /* @@ -3127,7 +3107,6 @@ local_recovery(const struct tt_uuid *instance_uuid, } stream_guard.is_active = false; recovery_finalize(recovery); - is_local_recovery = false; /* * We must enable WAL before finalizing engine recovery,