]> git.ipfire.org Git - thirdparty/knot-dns.git/commitdiff
catalog: fail zone-update if failed cat interpret
authorLibor Peltan <libor.peltan@nic.cz>
Wed, 27 Oct 2021 18:11:15 +0000 (20:11 +0200)
committerDaniel Salzman <daniel.salzman@nic.cz>
Mon, 1 Nov 2021 11:06:13 +0000 (12:06 +0100)
src/knot/updates/zone-update.c

index 25eb2579d8545484a97d2a765e4667bdb930d2ff..31ae6073117620661a8cffe3d3903dd5cabee9e3 100644 (file)
@@ -925,6 +925,13 @@ int zone_update_commit(conf_t *conf, zone_update_t *update)
                }
        }
 
+       ret = update_catalog(conf, update);
+       if (ret != KNOT_EOK) {
+               log_zone_error(update->zone->name, "failed to process catalog zone (%s)", knot_strerror(ret));
+               discard_adds_tree(update);
+               return ret;
+       }
+
        ret = commit_journal(conf, update);
        if (ret != KNOT_EOK) {
                discard_adds_tree(update);
@@ -945,14 +952,6 @@ int zone_update_commit(conf_t *conf, zone_update_t *update)
        zone_contents_t *old_contents;
        old_contents = zone_switch_contents(update->zone, update->new_cont);
 
-       ret = update_catalog(conf, update);
-       if (ret == KNOT_EZONEINVAL) {
-               log_zone_warning(update->zone->name, "invalid catalog zone version");
-       } else if (ret != KNOT_EOK) {
-               log_zone_warning(update->zone->name, "catalog zone not fully populated (%s)",
-                                knot_strerror(ret));
-       }
-
        if (update->flags & (UPDATE_INCREMENTAL | UPDATE_HYBRID)) {
                changeset_clear(&update->change);
                changeset_clear(&update->extra_ch);