diff --git a/src/box/gc.c b/src/box/gc.c index a2c963e0a3e06d78a147514c4da85250bf1e6378..e0df92473010201690387b28886d5c39027f2eb8 100644 --- a/src/box/gc.c +++ b/src/box/gc.c @@ -404,11 +404,18 @@ gc_checkpoint(void) } /* - * Reset the schedule and wake up the checkpoint daemon - * so that it can readjust. + * Since a user invoked a snapshot manually, this may be + * because he may be not happy with the current randomized + * schedule. Randomize the schedule again and wake up the + * checkpoint daemon so that it * can readjust. + * It is also a good idea to randomize the interval, since + * otherwise many instances running on the same host will + * no longer run their checkpoints randomly after + * a sweeping box.snapshot() (gh-4432). */ - checkpoint_schedule_reset(&gc.checkpoint_schedule, - ev_monotonic_now(loop())); + checkpoint_schedule_cfg(&gc.checkpoint_schedule, + ev_monotonic_now(loop()), + gc.checkpoint_schedule.interval); fiber_wakeup(gc.checkpoint_fiber); if (gc_do_checkpoint() != 0) diff --git a/src/box/gc.h b/src/box/gc.h index 5790ebcc6a9228f7007c29451f82a77700505d55..827a5db8ebf1955cb99d89fad8a86f3883683756 100644 --- a/src/box/gc.h +++ b/src/box/gc.h @@ -240,7 +240,9 @@ void gc_add_checkpoint(const struct vclock *vclock); /** - * Make a checkpoint. + * Make a *manual* checkpoint. + * This is entry point for box.snapshot() and SIGUSR1 signal + * handler. * * This function runs engine/WAL callbacks to create a checkpoint * on disk, then tracks the new checkpoint in the garbage collector