]> git.ipfire.org Git - thirdparty/knot-dns.git/commitdiff
implemented parallel adjusting
authorLibor Peltan <libor.peltan@nic.cz>
Thu, 7 Nov 2019 16:56:44 +0000 (17:56 +0100)
committerDaniel Salzman <daniel.salzman@nic.cz>
Tue, 26 May 2020 17:28:13 +0000 (19:28 +0200)
18 files changed:
doc/man/knot.conf.5in
doc/reference.rst
src/knot/conf/schema.c
src/knot/conf/schema.h
src/knot/dnssec/nsec-chain.c
src/knot/dnssec/nsec3-chain.c
src/knot/dnssec/zone-events.c
src/knot/events/handlers/refresh.c
src/knot/updates/zone-update.c
src/knot/zone/adjust.c
src/knot/zone/adjust.h
src/knot/zone/zone-load.c
src/knot/zone/zonefile.c
src/knot/zone/zonefile.h
src/utils/kzonecheck/zone_check.c
tests-extra/tools/dnstest/server.py
tests/knot/test_server.h
tests/knot/test_zone-update.c

index 5a739fc2e3ae26c00999e05582cf2bb8da40b0e0..58ae1ffe881855d7d0f31c5076229ab5cb5acfc8 100644 (file)
@@ -1303,6 +1303,7 @@ zone:
     journal\-max\-usage: SIZE
     journal\-max\-depth: INT
     zone\-max\-size : SIZE
+    adjust\-threads: INT
     dnssec\-signing: BOOL
     dnssec\-policy: STR
     serial\-policy: increment | unixtime | dateserial
@@ -1511,6 +1512,13 @@ the records in the transfer is twice the configured value. However the final
 size of the zone must satisfy the configured value.
 .sp
 \fIDefault:\fP 2^64
+.SS adjust\-threads
+.sp
+Parallelize internal zone adjusting procedures. This is useful with huge
+zones with NSEC3. Speedup observable at server startup and while processing
+NSEC3 re\-salt.
+.sp
+\fIDefault:\fP 1
 .SS dnssec\-signing
 .sp
 If enabled, automatic DNSSEC signing for the zone is turned on.
index 8b752ffc857fe1aa2642a5a9038a83f0f3c0b917..7c9b118963bed9e72c9b745db7669572b2ad9e87 100644 (file)
@@ -1429,6 +1429,7 @@ Definition of zones served by the server.
      journal-max-usage: SIZE
      journal-max-depth: INT
      zone-max-size : SIZE
+     adjust-threads: INT
      dnssec-signing: BOOL
      dnssec-policy: STR
      serial-policy: increment | unixtime | dateserial
@@ -1655,6 +1656,17 @@ size of the zone must satisfy the configured value.
 
 *Default:* 2^64
 
+.. _zone_adjust-threads:
+
+adjust-threads
+--------------
+
+Parallelize internal zone adjusting procedures. This is useful with huge
+zones with NSEC3. Speedup observable at server startup and while processing
+NSEC3 re-salt.
+
+*Default:* 1
+
 .. _zone_dnssec-signing:
 
 dnssec-signing
index 0df949ff6dfd39bd76f3f8e45e1e1ed682dc5ec0..b9998c50a19c378e21ed940dbf8c61940094f50e 100644 (file)
@@ -355,6 +355,7 @@ static const yp_item_t desc_policy[] = {
        { C_SERIAL_POLICY,       YP_TOPT,  YP_VOPT = { serial_policies, SERIAL_POLICY_INCREMENT } }, \
        { C_REFRESH_MAX_INTERVAL,YP_TINT,  YP_VINT = { 2, UINT32_MAX, UINT32_MAX, YP_STIME } }, \
        { C_REFRESH_MIN_INTERVAL,YP_TINT,  YP_VINT = { 2, UINT32_MAX, 2, YP_STIME } }, \
+       { C_ADJUST_THR,          YP_TINT,  YP_VINT = { 1, UINT16_MAX, 1 } }, \
        { C_MODULE,              YP_TDATA, YP_VDATA = { 0, NULL, mod_id_to_bin, mod_id_to_txt }, \
                                           YP_FMULTI | FLAGS, { check_modref } }, \
        { C_COMMENT,             YP_TSTR,  YP_VNONE }, \
index 3b7cb1b50f0c889297a728739461e4e11acd00a8..2932401302e0a2893628ec9b5121084489b08771 100644 (file)
@@ -22,6 +22,7 @@
 #define C_ACL                  "\x03""acl"
 #define C_ACTION               "\x06""action"
 #define C_ADDR                 "\x07""address"
+#define C_ADJUST_THR           "\x0E""adjust-threads"
 #define C_ALG                  "\x09""algorithm"
 #define C_ANS_ROTATION         "\x0F""answer-rotation"
 #define C_ANY                  "\x03""any"
index d9ae7d49b95e311c44549f2f6cffd83230e8363f..1492482bc3e8d93c06902c58b736732832cc9f3f 100644 (file)
@@ -490,7 +490,7 @@ int knot_nsec_fix_chain(zone_update_t *update, uint32_t ttl)
                return ret;
        }
 
-       ret = zone_adjust_contents(update->new_cont, adjust_cb_void, NULL, false, update->a_ctx->node_ptrs);
+       ret = zone_adjust_contents(update->new_cont, adjust_cb_void, NULL, false, true, 1, update->a_ctx->node_ptrs);
        if (ret != KNOT_EOK) {
                return ret;
        }
index addff4ec9b01592de6c087a638833af7dfd9ff50..17e61265d238dac5a6b57f15e9b3ac6b38a7a1e0 100644 (file)
@@ -800,7 +800,7 @@ int knot_nsec3_fix_chain(zone_update_t *update,
                return ret;
        }
 
-       ret = zone_adjust_contents(update->new_cont, NULL, adjust_cb_void, false, update->a_ctx->node_ptrs);
+       ret = zone_adjust_contents(update->new_cont, NULL, adjust_cb_void, false, true, 1, update->a_ctx->node_ptrs);
        if (ret != KNOT_EOK) {
                return ret;
        }
index 305cd391a80f1927268484ed83012c0cd616e5b6..9d1443601b77755d6d377a8ac24d5423a67c5858 100644 (file)
@@ -181,7 +181,8 @@ int knot_dnssec_zone_sign(zone_update_t *update,
                goto done;
        }
 
-       result = zone_adjust_contents(update->new_cont, adjust_cb_flags, NULL, false, update->a_ctx->node_ptrs);
+       result = zone_adjust_contents(update->new_cont, adjust_cb_flags, NULL,
+                                     false, false, 1, update->a_ctx->node_ptrs);
        if (result != KNOT_EOK) {
                return result;
        }
@@ -262,7 +263,7 @@ int knot_dnssec_sign_update(zone_update_t *update, zone_sign_reschedule_t *resch
                goto done;
        }
 
-       result = zone_adjust_contents(update->new_cont, adjust_cb_flags, NULL, false, update->a_ctx->node_ptrs);
+       result = zone_adjust_contents(update->new_cont, adjust_cb_flags, NULL, false, false, 1, update->a_ctx->node_ptrs);
        if (result != KNOT_EOK) {
                goto done;
        }
index c24a6ad86129aaf7ef4018666201ba83921e6f11..a4a4bf1b6f34a432f67816db63f6806fc2dc0e5e 100644 (file)
@@ -152,13 +152,19 @@ static time_t bootstrap_next(const zone_timers_t *timers)
        return interval;
 }
 
-static int xfr_validate(zone_contents_t *zone, struct refresh_data *data)
+static int xfr_validate(zone_contents_t *zone)
 {
+       // adjust_cb_nsec3_pointer not needed as we don't check DNSSEC here
+       int ret = zone_adjust_contents(zone, adjust_cb_flags, NULL, false, false, 1, NULL);
+       if (ret != KNOT_EOK) {
+               return ret;
+       }
+
        sem_handler_t handler = {
                .cb = err_handler_logger
        };
 
-       int ret = sem_checks_process(zone, false, &handler, time(NULL));
+       ret = sem_checks_process(zone, false, &handler, time(NULL));
        if (ret != KNOT_EOK) {
                // error is logged by the error handler
                return ret;
@@ -246,10 +252,7 @@ static int axfr_finalize(struct refresh_data *data)
 {
        zone_contents_t *new_zone = data->axfr.zone;
 
-       int ret = zone_adjust_contents(new_zone, adjust_cb_flags, NULL, false, NULL); // adjust_cb_nsec3_pointer not needed as we don't check DNSSEC in xfr_validate()
-       if (ret == KNOT_EOK) {
-               ret = xfr_validate(new_zone, data);
-       }
+       int ret = xfr_validate(new_zone);
        if (ret != KNOT_EOK) {
                return ret;
        }
@@ -521,10 +524,7 @@ static int ixfr_finalize(struct refresh_data *data)
                }
        }
 
-       ret = zone_adjust_contents(up.new_cont, adjust_cb_flags, NULL, false, NULL); // adjust_cb_nsec3_pointer not needed as we don't check DNSSEC in xfr_validate()
-       if (ret == KNOT_EOK) {
-               ret = xfr_validate(up.new_cont, data);
-       }
+       ret = xfr_validate(up.new_cont);
        if (ret != KNOT_EOK) {
                zone_update_clear(&up);
                return ret;
index 962eced011cd0ffe84b872d71caf4b547f8736b4..81589d1eee464735f835618d4eaa29e57201c596 100644 (file)
@@ -790,8 +790,9 @@ int zone_update_commit(conf_t *conf, zone_update_t *update)
                return ret;
        }
 
+       conf_val_t thr = conf_zone_get(conf, C_ADJUST_THR, update->zone->name);
        if ((update->flags & (UPDATE_HYBRID | UPDATE_FULL))) {
-               ret = zone_adjust_full(update->new_cont);
+               ret = zone_adjust_full(update->new_cont, conf_int(&thr));
        } else {
                ret = zone_adjust_incremental_update(update);
        }
index 45aedcbec8caff3199e502df38c4841df7b97de1..f6a65fd453710f601c59a6ebbf55cdb7666fede5 100644 (file)
@@ -295,6 +295,14 @@ typedef struct {
        adjust_cb_t adjust_cb;
        bool adjust_prevs;
        measure_t *m;
+
+       // just for parallel
+       unsigned threads;
+       unsigned thr_id;
+       size_t i;
+       pthread_t thread;
+       int ret;
+       zone_tree_t *tree;
 } zone_adjust_arg_t;
 
 static int adjust_single(zone_node_t *node, void *data)
@@ -304,7 +312,16 @@ static int adjust_single(zone_node_t *node, void *data)
 
        zone_adjust_arg_t *args = (zone_adjust_arg_t *)data;
 
-       knot_measure_node(node, args->m);
+       // parallel adjust support
+       if (args->threads > 1) {
+               if (args->i++ % args->threads != args->thr_id) {
+                       return KNOT_EOK;
+               }
+       }
+
+       if (args->m != NULL) {
+               knot_measure_node(node, args->m);
+       }
 
        if ((node->flags & NODE_FLAGS_DELETED)) {
                return KNOT_EOK;
@@ -357,8 +374,53 @@ static int zone_adjust_tree(zone_tree_t *tree, adjust_ctx_t *ctx, adjust_cb_t ad
        return KNOT_EOK;
 }
 
+static void *adjust_tree_thread(void *ctx)
+{
+       zone_adjust_arg_t *arg = ctx;
+
+       arg->ret = zone_tree_apply(arg->tree, adjust_single, ctx);
+
+       return NULL;
+}
+
+static int zone_adjust_tree_parallel(zone_tree_t *tree, adjust_ctx_t *ctx,
+                                     adjust_cb_t adjust_cb, unsigned threads)
+{
+       if (zone_tree_is_empty(tree)) {
+               return KNOT_EOK;
+       }
+
+       zone_adjust_arg_t arg[threads];
+       int ret = KNOT_EOK;
+
+       for (unsigned i = 0; i < threads; i++) {
+               arg[i].ctx = ctx;
+               arg[i].adjust_cb = adjust_cb;
+               arg[i].adjust_prevs = false;
+               arg[i].first_node = NULL;
+               arg[i].m = NULL;
+               arg[i].tree = tree;
+               arg[i].threads = threads;
+               arg[i].i = 0;
+               arg[i].thr_id = i;
+               arg[i].ret = pthread_create(&arg[i].thread, NULL, adjust_tree_thread, &arg[i]);
+       }
+
+       for (unsigned i = 0; i < threads; i++) {
+               if (arg[i].ret != -KNOT_EAGAIN) {
+                       pthread_join(arg[i].thread, NULL);
+               }
+               if (ret == KNOT_EOK) {
+                       ret = arg[i].ret;
+               }
+       }
+
+       return ret;
+}
+
 int zone_adjust_contents(zone_contents_t *zone, adjust_cb_t nodes_cb, adjust_cb_t nsec3_cb,
-                         bool measure_zone, zone_tree_t *add_changed)
+                         bool measure_zone, bool adjust_prevs, unsigned threads,
+                         zone_tree_t *add_changed)
 {
        int ret = zone_contents_load_nsec3param(zone);
        if (ret != KNOT_EOK) {
@@ -372,12 +434,28 @@ int zone_adjust_contents(zone_contents_t *zone, adjust_cb_t nodes_cb, adjust_cb_
        measure_t m = knot_measure_init(measure_zone, false);
        adjust_ctx_t ctx = { zone, add_changed, true };
 
-       if (nsec3_cb != NULL) {
-               ret = zone_adjust_tree(zone->nsec3_nodes, &ctx, nsec3_cb, true, &m);
-       }
-       if (ret == KNOT_EOK && nodes_cb != NULL) {
-               ret = zone_adjust_tree(zone->nodes, &ctx, nodes_cb, true, &m);
+       if (threads > 1) {
+               assert(nodes_cb != adjust_cb_flags); // This cb demands parent to be adjusted before child
+                                                    // => required sequential adjusting (also true for
+                                                    // adjust_cb_flags_and_nsec3) !!
+               assert(!measure_zone);
+               assert(!adjust_prevs);
+               assert(add_changed == NULL);
+               if (nsec3_cb != NULL) {
+                       ret = zone_adjust_tree_parallel(zone->nsec3_nodes, &ctx, nsec3_cb, threads);
+               }
+               if (ret == KNOT_EOK && nodes_cb != NULL) {
+                       ret = zone_adjust_tree_parallel(zone->nodes, &ctx, nodes_cb, threads);
+               }
+       } else {
+               if (nsec3_cb != NULL) {
+                       ret = zone_adjust_tree(zone->nsec3_nodes, &ctx, nsec3_cb, adjust_prevs, &m);
+               }
+               if (ret == KNOT_EOK && nodes_cb != NULL) {
+                       ret = zone_adjust_tree(zone->nodes, &ctx, nodes_cb, adjust_prevs, &m);
+               }
        }
+
        if (ret == KNOT_EOK && measure_zone && nodes_cb != NULL && nsec3_cb != NULL) {
                knot_measure_finish_zone(&m, zone);
        }
@@ -402,11 +480,13 @@ int zone_adjust_update(zone_update_t *update, adjust_cb_t nodes_cb, adjust_cb_t
        return ret;
 }
 
-int zone_adjust_full(zone_contents_t *zone)
+int zone_adjust_full(zone_contents_t *zone, unsigned threads)
 {
-       int ret = zone_adjust_contents(zone, adjust_cb_flags, adjust_cb_nsec3_flags, true, NULL);
+       int ret = zone_adjust_contents(zone, adjust_cb_flags, adjust_cb_nsec3_flags,
+                                      true, true, 1, NULL);
        if (ret == KNOT_EOK) {
-               ret = zone_adjust_contents(zone, adjust_cb_nsec3_and_additionals, NULL, false, NULL);
+               ret = zone_adjust_contents(zone, adjust_cb_nsec3_and_additionals, NULL,
+                                          false, false, threads, NULL);
        }
        if (ret == KNOT_EOK) {
                additionals_tree_free(zone->adds_tree);
@@ -438,10 +518,11 @@ int zone_adjust_incremental_update(zone_update_t *update)
        bool nsec3change = zone_update_changed_nsec3param(update);
        adjust_ctx_t ctx = { update->new_cont, update->a_ctx->adjust_ptrs, nsec3change };
 
-       ret = zone_adjust_contents(update->new_cont, adjust_cb_flags, adjust_cb_nsec3_flags, false, update->a_ctx->adjust_ptrs);
+       ret = zone_adjust_contents(update->new_cont, adjust_cb_flags, adjust_cb_nsec3_flags,
+                                  false, true, 1, update->a_ctx->adjust_ptrs);
        if (ret == KNOT_EOK) {
                if (nsec3change) {
-                       ret = zone_adjust_contents(update->new_cont, adjust_cb_wildcard_nsec3, adjust_cb_void, true, update->a_ctx->adjust_ptrs);
+                       ret = zone_adjust_contents(update->new_cont, adjust_cb_wildcard_nsec3, adjust_cb_void, true, false, 1, update->a_ctx->adjust_ptrs);
                } else {
                        ret = zone_adjust_update(update, adjust_cb_wildcard_nsec3, adjust_cb_void, true);
                }
@@ -470,7 +551,7 @@ int zone_adjust_incremental_update(zone_update_t *update)
        }
        if (ret == KNOT_EOK) {
                if (nsec3change) {
-                       ret = zone_adjust_contents(update->new_cont, adjust_cb_nsec3_pointer, adjust_cb_void, false, update->a_ctx->adjust_ptrs);
+                       ret = zone_adjust_contents(update->new_cont, adjust_cb_nsec3_pointer, adjust_cb_void, false, false, 1, update->a_ctx->adjust_ptrs);
                } else {
                        ret = additionals_reverse_apply_multi(
                                update->new_cont->adds_tree,
index 45d2363829c5070116811980e4d2a93a20d9609a..9ac8dada90d2091c7605195cff832ac957c70dab 100644 (file)
@@ -70,12 +70,15 @@ int adjust_cb_void(zone_node_t *node, adjust_ctx_t *ctx);
  * \param nodes_cb      Callback for NORMAL nodes.
  * \param nsec3_cb      Callback for NSEC3 nodes.
  * \param measure_zone  While adjusting, count the size and max TTL of the zone.
+ * \param adjust_prevs  Also (re-)generate node->prev pointers.
+ * \param threads       Operate in parallel using specified threads.
  * \param add_changed   Special tree to add any changed node (by adjusting) into.
  *
  * \return KNOT_E*
  */
 int zone_adjust_contents(zone_contents_t *zone, adjust_cb_t nodes_cb, adjust_cb_t nsec3_cb,
-                         bool measure_zone, zone_tree_t *add_changed);
+                         bool measure_zone, bool adjust_prevs, unsigned threads,
+                         zone_tree_t *add_changed);
 
 /*!
  * \brief Apply callback to nodes affected by the zone update.
@@ -99,11 +102,12 @@ int zone_adjust_update(zone_update_t *update, adjust_cb_t nodes_cb, adjust_cb_t
  * This operates in two phases, first fix basic node flags and prev pointers,
  * than nsec3-related pointers and additionals.
  *
- * \param zone   Zone to be adjusted.
+ * \param zone     Zone to be adjusted.
+ * \param threads  Parallelize some adjusting using specified threads.
  *
  * \return KNOT_E*
  */
-int zone_adjust_full(zone_contents_t *zone);
+int zone_adjust_full(zone_contents_t *zone, unsigned threads);
 
 /*!
  * \brief Do a generally approved adjust after incremental update.
index 5799c5a210d53b3d5acaa2df9c768c66b843f759..8db35e1bb3145151d6a3411ee5362ce0fec5c90c 100644 (file)
@@ -33,9 +33,10 @@ int zone_load_contents(conf_t *conf, const knot_dname_t *zone_name,
 
        char *zonefile = conf_zonefile(conf, zone_name);
        conf_val_t val = conf_zone_get(conf, C_SEM_CHECKS, zone_name);
+       conf_val_t thr = conf_zone_get(conf, C_ADJUST_THR, zone_name);
 
        zloader_t zl;
-       int ret = zonefile_open(&zl, zonefile, zone_name, conf_bool(&val), time(NULL));
+       int ret = zonefile_open(&zl, zonefile, zone_name, conf_bool(&val), conf_int(&thr), time(NULL));
        free(zonefile);
        if (ret != KNOT_EOK) {
                return ret;
index a4c7a219a6387d196cedb71b3c0ce5fa1523bfce..ecff32d4dbd072ccdc432b21c07fe62641f7e019 100644 (file)
@@ -137,7 +137,8 @@ static void process_data(zs_scanner_t *scanner)
 }
 
 int zonefile_open(zloader_t *loader, const char *source,
-                 const knot_dname_t *origin, bool semantic_checks, time_t time)
+                  const knot_dname_t *origin, bool semantic_checks,
+                  unsigned adjusting_threads, time_t time)
 {
        if (!loader) {
                return KNOT_EINVAL;
@@ -185,6 +186,7 @@ int zonefile_open(zloader_t *loader, const char *source,
        loader->source = strdup(source);
        loader->creator = zc;
        loader->semantic_checks = semantic_checks;
+       loader->adjust_threads = adjusting_threads;
        loader->time = time;
 
        return KNOT_EOK;
@@ -226,7 +228,7 @@ zone_contents_t *zonefile_load(zloader_t *loader)
                goto fail;
        }
 
-       ret = zone_adjust_contents(zc->z, adjust_cb_flags_and_nsec3, adjust_cb_nsec3_flags, true, NULL);
+       ret = zone_adjust_contents(zc->z, adjust_cb_flags_and_nsec3, adjust_cb_nsec3_flags, true, true, 1, NULL);
        if (ret != KNOT_EOK) {
                ERROR(zname, "failed to finalize zone contents (%s)",
                      knot_strerror(ret));
@@ -244,7 +246,7 @@ zone_contents_t *zonefile_load(zloader_t *loader)
 
        /* The contents will now change possibly messing up NSEC3 tree, it will
           be adjusted again at zone_update_commit. */
-       ret = zone_adjust_contents(zc->z, unadjust_cb_point_to_nsec3, NULL, false, NULL);
+       ret = zone_adjust_contents(zc->z, unadjust_cb_point_to_nsec3, NULL, false, false, loader->adjust_threads, NULL);
        if (ret != KNOT_EOK) {
                ERROR(zname, "failed to finalize zone contents (%s)",
                      knot_strerror(ret));
index df7c161fe7c500c2f1dc39920d35c16df42618ab..1b40e47fdb898feb61a20937776022607e3eb980 100644 (file)
@@ -37,6 +37,7 @@ typedef struct zcreator {
 typedef struct {
        char *source;                /*!< Zone source file. */
        bool semantic_checks;        /*!< Do semantic checks. */
+       unsigned adjust_threads;     /*!< Parallelize adjusting. */
        sem_handler_t *err_handler;  /*!< Semantic checks error handler. */
        zcreator_t *creator;         /*!< Loader context. */
        zs_scanner_t scanner;        /*!< Zone scanner. */
@@ -53,13 +54,15 @@ void err_handler_logger(sem_handler_t *handler, const zone_contents_t *zone,
  * \param source Source file name.
  * \param origin Zone origin.
  * \param semantic_checks Perform semantic checks.
+ * \param adjusting_threads Paralellize adjusting.
  * \param time Time for semantic check.
  *
  * \retval Initialized loader on success.
  * \retval NULL on error.
  */
 int zonefile_open(zloader_t *loader, const char *source,
-                  const knot_dname_t *origin, bool semantic_checks, time_t time);
+                  const knot_dname_t *origin, bool semantic_checks,
+                  unsigned adjusting_threads, time_t time);
 
 /*!
  * \brief Loads zone from a zone file.
index 1b32736e0db4dd932e793d3290f80ae96373ee0e..67618eebee6ccef27308e96e1d6808bbf5374fa2 100644 (file)
@@ -71,7 +71,7 @@ int zone_check(const char *zone_file, const knot_dname_t *zone_name,
        };
 
        zloader_t zl;
-       int ret = zonefile_open(&zl, zone_file, zone_name, true, time);
+       int ret = zonefile_open(&zl, zone_file, zone_name, true, 1, time);
        if (ret != KNOT_EOK) {
                return ret;
        }
index fb6fdd497fa089cd365d306680a48d82768a027e..53f782a35b1f7aebecdca392d10eefbbf73eec9c 100644 (file)
@@ -1293,6 +1293,7 @@ class Knot(Server):
         s.item_str("storage", self.dir)
         s.item_str("zonefile-sync", self.zonefile_sync)
         s.item_str("journal-max-usage", self.journal_max_usage)
+        s.item_str("adjust-threads", str(random.randint(1,4)))
         s.item_str("semantic-checks", "on" if self.semantic_check else "off")
         if len(self.modules) > 0:
             modules = ""
index b07d347f55d672f7bf2ee6a7e77b88eac197f54c..59f58e23da9f560007f39c19183d1968306a68df 100644 (file)
@@ -1,4 +1,4 @@
-/*  Copyright (C) 2019 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
+/*  Copyright (C) 2020 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
 
     This program is free software: you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -53,7 +53,7 @@ static inline void create_root_zone(server_t *server, knot_mm_t *mm)
        knot_rrset_free(soa, mm);
 
        /* Bake the zone. */
-       (void)zone_adjust_full(root->contents);
+       (void)zone_adjust_full(root->contents, 1);
 
        /* Switch zone db. */
        knot_zonedb_free(&server->zone_db);
index 40299cc2e73453b356e2277b589ad9273df5f807..5bcbbb3a18babf08c50af7c81ed759f0703594bb 100644 (file)
@@ -1,4 +1,4 @@
-/*  Copyright (C) 2019 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
+/*  Copyright (C) 2020 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
 
     This program is free software: you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -277,7 +277,7 @@ void test_incremental(zone_t *zone, zs_scanner_t *sc)
 
        size_t zone_size1 = zone->contents->size;
        uint32_t zone_max_ttl1 = zone->contents->max_ttl;
-       ret = zone_adjust_full(zone->contents);
+       ret = zone_adjust_full(zone->contents, 2);
        ok(ret == KNOT_EOK, "zone adjust full shall work");
        size_t zone_size2 = zone->contents->size;
        uint32_t zone_max_ttl2 = zone->contents->max_ttl;