Commit Diff
Diff:
3ea53af3f7556789c0f144f3dd4a1f82a52d8443
6ffcf8abf4fe2d9a0554c0c1d2183c6a2bab93df
Commit:
6ffcf8abf4fe2d9a0554c0c1d2183c6a2bab93df
Tree:
1a691f86378e7fbc467c75bce54a0bd86ccf6519
Author:
pjp <pjp@delphinusdns.org>
Committer:
pjp <pjp@delphinusdns.org>
Date:
Tue Apr 7 16:31:31 2020 UTC
Message:
when scheduling restarts on replicants, it is wise to only pick a random time once in order to greaten the chances that there is an offset between replicant servers (if there is more than 1 replicant). The random time selection works like the ethernet CSMR/CD and when there is a lot of zones that need update each would pick a time to restart before. This was flawed and this fixes it.
blob - 905e794238a26c8b8b35d5ca3ad1e3c40c2a9f6a
blob + 304050772b4f7a541763a27e031b8fcc963d6bfc
--- CHANGES
+++ CHANGES
@@ -5,6 +5,8 @@ Changes in RELEASE_1_5 from RELEASE_1_4
- switch default algorithm to alg 13 (elliptic curve) instead of alg 8 (RSA)
- not specifying a tsigkey in rzone should now imply NOKEY
- multiple RRSIG's are now working without bugs
+- fixed the random time restart algorithm to restart at only 1 desired time
+ which increases the odds that replicants won't do it at the same time.
Changes in RELEASE_1_4 from RELEASE_1_3
blob - 52f695f8321389aa78dcdae3fa24c876caa77feb
blob + 38ed89ea39818bb8210e8ac83a04e15e02445221
--- raxfr.c
+++ raxfr.c
@@ -26,7 +26,7 @@
*
*/
/*
- * $Id: raxfr.c,v 1.50 2020/03/10 10:04:46 pjp Exp $
+ * $Id: raxfr.c,v 1.51 2020/04/07 16:31:31 pjp Exp $
*/
#include <sys/types.h>
@@ -1606,6 +1606,17 @@ schedule_retry(char *zonename, time_t seconds)
static void
schedule_restart(char *zonename, time_t seconds)
{
+
+ LIST_FOREACH(sp0, &myschedules, myschedule_entry) {
+ if (sp0->action == SCHEDULE_ACTION_RESTART)
+ break;
+ }
+
+ if (sp0 != NULL) {
+ dolog(LOG_INFO, "found an existing restart entry, scheduling restart at %s", ctime(&sp0->when));
+ return;
+ }
+
sp0 = calloc(1, sizeof(struct myschedule));
if (sp0 == NULL)
return;
repomaster@centroid.eu