]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Remove name boundary optimization 12142/head
authorAlessio Podda <alessio@isc.org>
Fri, 22 May 2026 15:58:10 +0000 (17:58 +0200)
committerAlessio Podda <alessio@isc.org>
Mon, 1 Jun 2026 11:49:55 +0000 (13:49 +0200)
In MR !9740, we introduced an optimization that reduces memory usage
by processing rdatas in batches during AXFR.

The maximum batch size is 128, but the batch size was allowed to grow
beyond that limit if all rdatas in a batch were for the same name, as
that allows a more efficient optimization.

This optimization could theoretically allow the batch size arbitrarily
for a sufficient large zone transfer. Since synthetic tests don't show
any performance improvement from the optimization, this MR removes it.

(cherry picked from commit 7502e73333943fb45ce0a679aac5ccfce75012aa)

lib/dns/diff.c
lib/dns/include/dns/diff.h
lib/dns/xfrin.c

index 5ce472cecec50abc3eee2fee80b5c6eb64467b0c..82f7c2fef428075f4fd448eaa7f68f79ea3ebd49 100644 (file)
@@ -150,19 +150,6 @@ dns_diff_append(dns_diff_t *diff, dns_difftuple_t **tuplep) {
        *tuplep = NULL;
 }
 
-bool
-dns_diff_is_boundary(const dns_diff_t *diff, dns_name_t *new_name) {
-       REQUIRE(DNS_DIFF_VALID(diff));
-       REQUIRE(DNS_NAME_VALID(new_name));
-
-       if (ISC_LIST_EMPTY(diff->tuples)) {
-               return false;
-       }
-
-       dns_difftuple_t *tail = ISC_LIST_TAIL(diff->tuples);
-       return !dns_name_caseequal(&tail->name, new_name);
-}
-
 size_t
 dns_diff_size(const dns_diff_t *diff) {
        REQUIRE(DNS_DIFF_VALID(diff));
index db37565d67f4f97cb43abf628296b4dd1e186675..6eaa4180833843d5bdb81f93b7cc9e58fc6a2a48 100644 (file)
@@ -194,16 +194,6 @@ dns_diff_append(dns_diff_t *diff, dns_difftuple_t **tuple);
  * \li The tuple has been freed, or will be freed when the diff is cleared.
  */
 
-bool
-dns_diff_is_boundary(const dns_diff_t *diff, dns_name_t *name);
-/*%<
- * Checks if 'name' is equal, up to case, to the last name of the diff.
- *
- * Requires:
- * \li 'diff' is a valid diff.
- * \li 'name' is a valid dns name.
- */
-
 size_t
 dns_diff_size(const dns_diff_t *diff);
 /*%<
index 1550d9e577f193cc8894e98fe28b005fcfaafd2e..2cec78b28c4869f649056b93b69976dfe59b2a1e 100644 (file)
@@ -318,10 +318,7 @@ axfr_putdata(dns_xfrin_t *xfr, dns_diffop_t op, dns_name_t *name, dns_ttl_t ttl,
        }
 
        CHECK(dns_zone_checknames(xfr->zone, name, rdata));
-
-       if (dns_diff_size(&xfr->diff) > 128 &&
-           dns_diff_is_boundary(&xfr->diff, name))
-       {
+       if (dns_diff_size(&xfr->diff) > 128) {
                xfrin_work_t work = (xfrin_work_t){
                        .magic = XFRIN_WORK_MAGIC,
                        .result = ISC_R_UNSET,