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 359836FC8F; Thu, 25 Mar 2021 01:10:14 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 359836FC8F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1616623814; bh=9vdKmas7yrCayIcTuitzbsIxEhX2f+0sGQ7oKp1xgfA=; 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=tqb2rAv5xbaLujCpNS3Wx7m+OlsImTLwV7kk38EzP+PQtRZ2BKOCasceH+UIV8H8T AECzqVMvpAI5mACPbKp3vqGuUtgloL8yd2X8zrwzc4twa/aFoS/t+gZRosHh5ShJra 8B0YNsNLsYC3H443afnea2Cy2xx0uAAeiz2knqEM= Received: from smtp55.i.mail.ru (smtp55.i.mail.ru [217.69.128.35]) (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 290DA6FC8F for ; Thu, 25 Mar 2021 01:10:13 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 290DA6FC8F Received: by smtp55.i.mail.ru with esmtpa (envelope-from ) id 1lPBhc-0002j4-JL; Thu, 25 Mar 2021 01:10:12 +0300 To: Cyrill Gorcunov , tml References: <20210324163759.1900553-1-gorcunov@gmail.com> <20210324163759.1900553-2-gorcunov@gmail.com> Message-ID: <8faa2e1e-c198-832d-d527-1acf2280720d@tarantool.org> Date: Wed, 24 Mar 2021 23:10:11 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210324163759.1900553-2-gorcunov@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD9064ADF4728AA0EE993662DB34D9B1ABD5A9410DDDE83AB43182A05F538085040DE858C07C8B7C01EF28FBBE330C985B05654BD3C532CBE631A96C972167C62EB X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7661D1C86A3B4DE39EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637CF05F7050DCA185A8638F802B75D45FF914D58D5BE9E6BC131B5C99E7648C95C5DD32608FC869F5D5434438E24758110CAE427F926CB0FB5A471835C12D1D9774AD6D5ED66289B5278DA827A17800CE77A825AB47F0FC8649FA2833FD35BB23D2EF20D2F80756B5F868A13BD56FB6657A471835C12D1D977725E5C173C3A84C34C82C86BFC697D19117882F4460429728AD0CFFFB425014E868A13BD56FB6657D81D268191BDAD3DC09775C1D3CA48CFFA79E84ED94DD554BA3038C0950A5D36C8A9BA7A39EFB766EC990983EF5C0329BA3038C0950A5D36D5E8D9A59859A8B6E8382B8379CE395176E601842F6C81A1F004C906525384307823802FF610243DF43C7A68FF6260569E8FC8737B5C2249EC8D19AE6D49635B3BBE47FD9DD3FB59A8DF7F3B2552694A2BEBFE083D3B9BA73A03B725D353964BB11811A4A51E3B096D1867E19FE14079BA9C0B312567BB23089D37D7C0E48F6CA18204E546F3947C83C798A30B85E16B5E1C53F199C2BB95C8A9BA7A39EFB7666BA297DBC24807EA089D37D7C0E48F6C8AA50765F7900637BBEA499411984DA1EFF80C71ABB335746BA297DBC24807EA27F269C8F02392CD6143B1329D1CCA5627F269C8F02392CD5571747095F342E88FB05168BE4CE3AF X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A2368A440D3B0F6089093C9A16E5BC824AC8B6CDF511875BC4E8F7B195E1C97831E2FD74A1AEDF655BB56C7EC614AE688F X-C1DE0DAB: 0D63561A33F958A559C3BC66C6382A0E3B32C711162ADC129D596AB2F8D30B78D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75F04B387B5D7535DE410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34FD9114F69CA58D1E8509E4F13FF1D5DA30C1FB92160CA705DCBE000823F759CE6192E4CAF330987A1D7E09C32AA3244C315497AB97A93D99F4BE53AA0C27DB9024AF4FAF06DA24FD729B2BEF169E0186 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojjqzNotmU+gcHR0Yxujr/IQ== X-Mailru-Sender: 504CC1E875BF3E7D9BC0E5172ADA31101F717F922F67B76D3BE1AF88B80EB57CEBC235C139CBE4A507784C02288277CA03E0582D3806FB6A5317862B1921BA260ED6CFD6382C13A6112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v4 1/3] gc/xlog: delay xlog cleanup until relays are subscribed 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" Hi! Thanks for the patch! All the CI jobs are red. Please, try to fix it. See 2 comments below. > diff --git a/src/box/box.cc b/src/box/box.cc > index cc59564e1..a269f7357 100644 > --- a/src/box/box.cc > +++ b/src/box/box.cc > @@ -1465,6 +1480,23 @@ box_set_wal_queue_max_size(void) > return 0; > } > > +int > +box_set_wal_cleanup_delay(void) > +{ > + double delay = box_check_wal_cleanup_delay(); > + if (delay < 0) > + return -1; > + /* > + * Anonymous replicas do not require > + * delay the cleanup procedure since they > + * are read only. 1. It is not related to being read-only. Besides, they can write to local spaces at least. I think it is because anyway they can't be a source of replication. There is no anybody to keep the files for. > + */ > + if (replication_anon) > + delay = 0; > + gc_set_wal_cleanup_delay(delay); > + return 0; > +} > diff --git a/src/box/gc.c b/src/box/gc.c > index 9af4ef958..8dbcbcede 100644 > --- a/src/box/gc.c > +++ b/src/box/gc.c> @@ -238,6 +243,41 @@ static int > gc_cleanup_fiber_f(va_list ap) > { > (void)ap; > + > + /* > + * Stage 1 (optional): in case if we're booting > + * up with cleanup disabled lets do wait in a > + * separate cycle to minimize branching on stage 2. > + */ > + if (gc.is_paused) { > + double start_time = fiber_clock(); > + while (!fiber_is_cancelled()) { > + double deadline = start_time + gc.wal_cleanup_delay; > + double timeout = gc.wal_cleanup_delay; 2. You didn't fix it really. Just that now the timeout is taken fresh from the config still making it possible to go beyond the deadline. The fact that fiber_clock() < deadline does not mean that fiber_clock() + timeout is also < deadline. You need to calculate the timeout properly and try to cover it with a test. > + > + if (fiber_clock() >= deadline || > + fiber_yield_timeout(timeout)) { > + say_info("wal/engine cleanup is resumed " > + "due to timeout expiration"); > + gc.is_paused = false; > + gc.delay_ref = 0; > + break; > + } > + > + /* > + * If a last reference is dropped > + * we can exit out early. > + */ > + if (!gc.is_paused) { > + say_info("wal/engine cleanup is resumed"); > + break; > + } > + } > + }