]> git.ipfire.org Git - thirdparty/knot-dns.git/commitdiff
load: apply journal on zonefile whenever possible...
authorLibor Peltan <libor.peltan@nic.cz>
Wed, 9 Mar 2022 11:57:44 +0000 (12:57 +0100)
committerLibor Peltan <libor.peltan@nic.cz>
Wed, 9 Mar 2022 11:57:44 +0000 (12:57 +0100)
this commit removes an optimization that with
no-cold start and zonefile evidently modified
it skips loading from journal whatsoever

it could have some marginal side-effects and is
no longer maintainable

src/knot/events/handlers/load.c

index b87def8bb765ce1ee831ecf5e64e9171e618f5af..8c83285905bb5afcaeaeb8bfebe5adaca8e4651f 100644 (file)
@@ -91,9 +91,6 @@ int event_load(conf_t *conf, zone_t *zone)
                struct timespec mtime;
                char *filename = conf_zonefile(conf, zone->name);
                ret = zonefile_exists(filename, &mtime);
-               bool zonefile_unchanged = (zone->zonefile.exists &&
-                                          zone->zonefile.mtime.tv_sec == mtime.tv_sec &&
-                                          zone->zonefile.mtime.tv_nsec == mtime.tv_nsec);
                if (ret == KNOT_EOK) {
                        ret = zone_load_contents(conf, zone->name, &zf_conts, false);
                }
@@ -132,11 +129,7 @@ int event_load(conf_t *conf, zone_t *zone)
                }
 
                // If configured and appliable to zonefile, load journal changes.
-               bool journal_load_configured1 = (load_from == JOURNAL_CONTENT_CHANGES);
-               bool journal_load_configured2 = (load_from == JOURNAL_CONTENT_ALL);
-
-               if ((journal_load_configured1 || journal_load_configured2) &&
-                   (!old_contents_exist || zonefile_unchanged)) {
+               if (load_from != JOURNAL_CONTENT_NONE) {
                        ret = zone_load_journal(conf, zone, zf_conts);
                        if (ret != KNOT_EOK) {
                                zone_contents_deep_free(zf_conts);