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 1ECF66EC5D; Mon, 5 Apr 2021 11:18:00 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 1ECF66EC5D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1617610680; bh=hcsWxG8RJu3lDMnafsuTsVkQCklzOEfu4XuqL8yGKbA=; 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=Gj9wL0nXmCsmOCqosUUJgWXRna9MuY39h/DpLaivwY3uxAfgOQIH5R+F8cVV3o3MT QTzxJvgStthcEWrpV4sYYLPhejP17Jaca+hCgEqblTSVJ3+KWHGmJMfCvYHgw0NMm6 nu84p/qRKrioGe/+KLoICIlawi/JSLVYwROAEJ6U= Received: from smtp37.i.mail.ru (smtp37.i.mail.ru [94.100.177.97]) (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 3E4B56EC5D for ; Mon, 5 Apr 2021 11:17:59 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 3E4B56EC5D Received: by smtp37.i.mail.ru with esmtpa (envelope-from ) id 1lTKQo-0005QB-67; Mon, 05 Apr 2021 11:17:58 +0300 To: Vladislav Shpilevoy , 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: Mon, 5 Apr 2021 11:17:57 +0300 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: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD9ED7173E37F4E32947427BE79D20CABD4ABD7C98AF5DBFD37182A05F538085040B43C2C597D01794587CC1D5F7A25B6AB695BA74F9EBD52DD1AD471EE7589C5CA X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7AC4684DF4EC4B256EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637CF20B9B7F5DD35A68638F802B75D45FF914D58D5BE9E6BC131B5C99E7648C95C16EE06F5A270FE6A4888B5B8763C1F4E74B0C0B7E6B77F98A471835C12D1D9774AD6D5ED66289B5278DA827A17800CE767883B903EA3BAEA9FA2833FD35BB23D2EF20D2F80756B5F868A13BD56FB6657A471835C12D1D977725E5C173C3A84C390BCC82C2C62A6D1117882F4460429728AD0CFFFB425014E868A13BD56FB6657D81D268191BDAD3DC09775C1D3CA48CFA607D462841869D1BA3038C0950A5D36C8A9BA7A39EFB766EC990983EF5C0329BA3038C0950A5D36D5E8D9A59859A8B6A435B89EBA43239D76E601842F6C81A1F004C906525384307823802FF610243DF43C7A68FF6260569E8FC8737B5C2249EC8D19AE6D49635B68655334FD4449CB9ECD01F8117BC8BEAAAE862A0553A39223F8577A6DFFEA7C3DDF88F19B2F251A43847C11F186F3C59DAA53EE0834AAEE X-C1DE0DAB: 0D63561A33F958A5B454F48DEF1DA0023127D5BFBE4601CA0CEE4000C8F762B2D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7502E6951B79FF9A3F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D3451BBE684D17D722118E232EBDC6C7238941B7474BA496783D5AF956580A33DFB9E9701236AA7BF851D7E09C32AA3244C08ABF5418802EF66E9A0A2B4F98CED38F94338140B71B8EE927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojM00ve/f+0onpdMullAzOQA== X-Mailru-Sender: 583F1D7ACE8F49BDD2846D59FC20E9F8046FB731471990F1B298FB9D097B4BF3C35EF65BECACBB07424AE0EB1F3D1D21E2978F233C3FAE6EE63DB1732555E4A8EE80603BA4A5B0BC112434F685709FCF0DA7A0AF5A3A8387 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: Serge Petrenko via Tarantool-patches Reply-To: Serge Petrenko Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" 03.04.2021 16:18, Vladislav Shpilevoy пишет: > 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. Thanks for the fixes! LGTM. > 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, -- Serge Petrenko