Tarantool development patches archive
 help / color / mirror / Atom feed
* [tarantool-patches] [PATCH] recovery: recount offset on checkpoint_interval change
@ 2018-07-09 14:03 Konstantin Belyavskiy
  2018-07-09 14:16 ` [tarantool-patches] " Georgy Kirichenko
  0 siblings, 1 reply; 2+ messages in thread
From: Konstantin Belyavskiy @ 2018-07-09 14:03 UTC (permalink / raw)
  To: tarantool-patches

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)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-07-09 14:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-09 14:03 [tarantool-patches] [PATCH] recovery: recount offset on checkpoint_interval change Konstantin Belyavskiy
2018-07-09 14:16 ` [tarantool-patches] " Georgy Kirichenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox