[tarantool-patches] [PATCH] recovery: recount offset on checkpoint_interval change

  • From: Konstantin Belyavskiy <k.belyavskiy@xxxxxxxxxxxxx>
  • To: tarantool-patches@xxxxxxxxxxxxx
  • Date: Mon, 9 Jul 2018 17:03:14 +0300

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)


Other related posts: