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 E790022C05 for ; Mon, 9 Jul 2018 10:03:18 -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 Yyk2WVW9b0-f for ; Mon, 9 Jul 2018 10:03:18 -0400 (EDT) Received: from smtp51.i.mail.ru (smtp51.i.mail.ru [94.100.177.111]) (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 1AF14229F2 for ; Mon, 9 Jul 2018 10:03:17 -0400 (EDT) Received: from [185.6.245.156] (port=12288 helo=localhost.localdomain) by smtp51.i.mail.ru with esmtpa (envelope-from ) id 1fcWl2-0000RX-05 for tarantool-patches@freelists.org; Mon, 09 Jul 2018 17:03:16 +0300 From: Konstantin Belyavskiy Subject: [tarantool-patches] [PATCH] recovery: recount offset on checkpoint_interval change Date: Mon, 9 Jul 2018 17:03:14 +0300 Message-Id: <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 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)