From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id D3EB8225C2 for ; Mon, 9 Jul 2018 10:16:58 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ig0qFd-yE_NT for ; Mon, 9 Jul 2018 10:16:58 -0400 (EDT) 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 turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 8C7A820E3D for ; Mon, 9 Jul 2018 10:16:58 -0400 (EDT) Received: from [185.6.245.156] (port=50348 helo=tarantool.org) by smtp55.i.mail.ru with esmtpa (envelope-from ) id 1fcWyG-00063K-AO for tarantool-patches@freelists.org; Mon, 09 Jul 2018 17:16:56 +0300 Date: Mon, 9 Jul 2018 17:16:54 +0300 From: Georgy Kirichenko Subject: [tarantool-patches] Re: [PATCH] recovery: recount offset on checkpoint_interval change Message-ID: <20180709141654.GA18875@tarantool.org> References: <20180709140314.96501-1-k.belyavskiy@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180709140314.96501-1-k.belyavskiy@tarantool.org> Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-subscribe: List-owner: List-post: List-archive: To: tarantool-patches@freelists.org Ok to merge On Mon, Jul 09, 2018 at 05:03:14PM +0300, Konstantin Belyavskiy wrote: > Next checkpoint time is set by the formula: > period = self.checkpoint_interval + offset, > where offset is defined as follow: > offset = random % self.checkpoint_interval > > So offset must be calculated again if at least the new > interval is less than the old one. > > Closes #3370 > --- > Ticket: https://github.com/tarantool/tarantool/issues/3370 > Branch: https://github.com/tarantool/tarantool/compare/kbelyavs/gh-3370-fix-bug-with-wrong-snapshot-scheduling > src/box/lua/checkpoint_daemon.lua | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/src/box/lua/checkpoint_daemon.lua b/src/box/lua/checkpoint_daemon.lua > index e7ef05fdb..ec129010f 100644 > --- a/src/box/lua/checkpoint_daemon.lua > +++ b/src/box/lua/checkpoint_daemon.lua > @@ -80,6 +80,7 @@ local function daemon_fiber(self) > break > elseif msg == 'reload' then > log.info("reloaded") -- continue > + offset = random % self.checkpoint_interval > elseif msg == nil and box.info.status == 'running' then > local s, e = pcall(process, self) > if not s then > -- > 2.14.3 (Apple Git-98) > >