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 5B1316EC5D; Fri, 2 Apr 2021 14:47:57 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 5B1316EC5D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1617364077; bh=5QyfNtI83ZgRvvAZDsmFDGRls6gU+3JZSI4odYZjmec=; 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=dkj/bjJeNhjHL5MV65O3jvF+aevyjIqJXaAfyCZ+p9wiC3NzOFOiKNSvbyGO062a2 YdwVXXuNa0qy/vjr3r4Jl9aC+FD847ffsK/q8E4Xu9EsEEGoKSPapJMuF4ulI3vnbu K5rAe7icfxyLXGsR7lh2TFyJKgpdWoJ34e3aEuwE= Received: from smtp59.i.mail.ru (smtp59.i.mail.ru [217.69.128.39]) (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 413836EC5E for ; Fri, 2 Apr 2021 14:47:29 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 413836EC5E Received: by smtp59.i.mail.ru with esmtpa (envelope-from ) id 1lSIGu-00013A-75; Fri, 02 Apr 2021 14:47:28 +0300 To: Vladislav Shpilevoy , tarantool-patches@dev.tarantool.org, gorcunov@gmail.com, korablev@tarantool.org References: <399ad30c78b2767cc6fe14e0f3b42045e0334216.1617315744.git.v.shpilevoy@tarantool.org> Message-ID: <87bd277d-f396-5354-b472-3c3ceecc8c4b@tarantool.org> Date: Fri, 2 Apr 2021 14:47:27 +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: <399ad30c78b2767cc6fe14e0f3b42045e0334216.1617315744.git.v.shpilevoy@tarantool.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD9ED7173E37F4E32947427BE79D20CABD4ABD7C98AF5DBFD37182A05F538085040A54D2E90A3429F5572E6417B62F8E582A343FF1F8FC5AC222800ED7583218BAC X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE737BB76880A4CA9A4EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006372338AE33E473C9B88638F802B75D45FF914D58D5BE9E6BC131B5C99E7648C95C7B5A45DDF210A4CF21ACDA08C5B9BBA422963C32A14ED67FA471835C12D1D9774AD6D5ED66289B5278DA827A17800CE7A4F00A9E8C511CEB9FA2833FD35BB23D2EF20D2F80756B5F868A13BD56FB6657A471835C12D1D977725E5C173C3A84C301200A96CB7104FF117882F4460429728AD0CFFFB425014E868A13BD56FB6657D81D268191BDAD3DC09775C1D3CA48CF5CEAC1C4BB3EFDC8BA3038C0950A5D36C8A9BA7A39EFB766EC990983EF5C0329BA3038C0950A5D36D5E8D9A59859A8B6AC37AC2B1429C73A76E601842F6C81A1F004C906525384307823802FF610243DF43C7A68FF6260569E8FC8737B5C2249EC8D19AE6D49635B68655334FD4449CB9ECD01F8117BC8BEAAAE862A0553A39223F8577A6DFFEA7CDDB9BF3B882869D543847C11F186F3C59DAA53EE0834AAEE X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A24A6D60772A99906F8E1CD14B953EB46D440D237AABBB18E2355D89D7DBCDD132 X-C1DE0DAB: 0D63561A33F958A5240D26D6A67B9C38D51020DAF1ED1235D10C07803EAB20F4D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7502E6951B79FF9A3F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D348D68DCC07DD06FF57682786D135F1875B53333DD787784A5421978148AE348C6F6081CCFE080F1891D7E09C32AA3244CA97642BFC45B4B454D4CE696FA0B43E005AB220A9D022EBC927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojiysexgWf337i/GmBGYmCLg== X-Mailru-Sender: 583F1D7ACE8F49BDD2846D59FC20E9F8985E5858D2E2A998F7F9D1FD7A5412D175ED0347C6C58DAB424AE0EB1F3D1D21E2978F233C3FAE6EE63DB1732555E4A8EE80603BA4A5B0BC112434F685709FCF0DA7A0AF5A3A8387 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" Hi! Thanks for the patch! 02.04.2021 01:23, Vladislav Shpilevoy пишет: > It was used so as to recover synchronous auto-commit transactions > in an async way (not blocking the fiber). But it became not > necessary since #5874 was fixed. Because recovery does not use > auto-commit transactions anymore. > > Closes #5194 > --- > src/box/box.cc | 12 +----------- > 1 file changed, 1 insertion(+), 11 deletions(-) > > diff --git a/src/box/box.cc b/src/box/box.cc > index f70a2bd0e..8eacbfebb 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,7 +239,6 @@ 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 > @@ -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. LGTM otherwise. > - 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(); > } > @@ -3037,7 +3029,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); > > /* > @@ -3096,7 +3087,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