Commit graph

44579 commits

Author SHA1 Message Date
Matthijs Mekking
a4e6fef81c Log serial when IXFR version not in journal
It may be useful to know which version (begin serial) is missing when
the IXFR version cannot be found.
2025-12-10 15:24:29 +00:00
Matthijs Mekking
d67dcac70e fix: usr: Fix slow speed of NSEC3 optout large delegation zone signing
BIND 9.20 takes much more time signing a large delegation zone with NSEC3 optout compared to version 9.18. This has been restored.

Closes #5672

Merge branch '5672-nsec3-optout-takes-too-long' into 'main'

See merge request isc-projects/bind9!11354
2025-12-10 13:54:46 +00:00
Matthijs Mekking
6f7abbfaac Don't create NSEC3 nodes for unsigned delegations
Instead of creating new nodes for every possible NSEC3 record, only
create them if we are actually going to add a new NSEC3 record.
2025-12-10 14:18:52 +01:00
Matthijs Mekking
41159e9062 Implement dns_dbiterator_seek3
This is a new seek function for dbiterator that is meant to find an
NSEC3 node in a zone database. The difference with dns_dbiterator_seek
is that if the node does not exist, this seek function will point the
iterator to the next NSEC3 name.
2025-12-10 14:18:52 +01:00
Matthijs Mekking
5e704bbb59 Add NSEC3 optout large delegation zone test case
This test signs a large delegation with mostly insecure delegations
with NSEC3 optout. Once the NSEC3PARAM record is published, run
dnssec-verify to ensure the zone is correctly signed.
2025-12-10 14:18:52 +01:00
Alessio Podda
22d49db2b0 chg: dev: Compact rdataset implementation for authoritative
This MR introduces a specialized rdataset implementation for authoritative workloads, which leads to substantial memory savings in our perflab tests.

Merge branch 'alessio/auth-compact-slabs' into 'main'

See merge request isc-projects/bind9!11269
2025-12-10 12:22:09 +00:00
Alessio Podda
f1d8c3059c Fix formatting 2025-12-10 12:18:34 +01:00
Alessio Podda
852041457e Add vecheader unit tests
Adds unit tests for the new rdatavec, doing basic size and case
checking.
2025-12-10 12:18:34 +01:00
Alessio Podda
9d74a91301 Add DNS_VECHEADER_FOREACH
Add a FOREACH macro modelled around the DNS_RDATASET_FOREACH one, that
uses vecheader directly. Useful when you want to manipulate a vecheader
without binding it to avoid having to take the node lock inside qpzone.c.
2025-12-10 12:18:34 +01:00
Alessio Podda
4eb0b23efc Switch qpzone to rdatavec
Replaces rdataslab with rdatavec inside qpzone.c. This leads to a 19.92%
reduction of used memory across perflab workloads.
2025-12-10 12:18:34 +01:00
Alessio Podda
f465976536 Document the memory layout of rdatavec 2025-12-10 12:18:34 +01:00
Alessio Podda
b2cad77aa7 Add rdatavec
Add an implementation of rdataset specialized for authoritative
workloads. For now, it is a copy of rdataslab, with redundant fields
from the header removed.
2025-12-10 12:18:34 +01:00
Alessio Podda
04fdf242a8 Add slist.h
Add a macro-based singly-linked list implementation to the codebase,
inspired by the doubly-linked list in list.h.
2025-12-10 12:18:34 +01:00
Alessio Podda
2d72b48e62 chg: dev: Remove unused foundname parameter
The `foundname` parameter in `qp.c:dns_qp_lookup` was effectively used only in unit tests, as in every case the name is needed, it can be retrieved directly from the node pointer. It also required an inefficient implementation that extracted the name by converting it into a key and then immediately converting it back.

This MR refactors `qp.c:dns_qp_lookup` not to have a foundname parameter, resulting in a 5% speedup in the handling of NXDOMAIN responses in perflab.

Merge branch 'alessio/qp-no-foundname' into 'main'

See merge request isc-projects/bind9!11339
2025-12-10 11:15:24 +00:00
Alessio Podda
4d698ee0e3 Fix formatting after refactor
The removal of the foundname and name parameters from various qp.c
functions led to formatting issues. Restore the correct formatting via
clang-format.
2025-12-10 11:28:10 +01:00
Alessio Podda
46e25bd0db Remove maybe_set_name
Outside of unit tests, the name parameter in dns_qpiter_<...> and
dns_qpchain_<...> is only used in context where the name can be
extracted directly from the underlying node.

This commits modifies the signatures of dns_qpiter_<...> and
dns_qpchain_<...> not to have a name parameter. Where the name parameter
was needed, we now query the node and copy the name directly from it.

This allows us to remove maybe_set_name from qp.c. Besides simplifying
the API, this leads to a performance speedup for NXDOMAIN handling,
as we avoid calling maybe_set_name inside step, and maybe_set_name is
very inefficient.

A copy of the implementation maybe_set_name is retained for the unit
tests.
2025-12-10 11:28:10 +01:00
Alessio Podda
14f880761b Remove unused foundname parameter
The `foundname` parameter in dns_qp_lookup is used only in the unit
tests. This commit simplifies the API by removing it, and modifying the
unit tests to extract the name from pval.
2025-12-10 11:28:10 +01:00
Evan Hunt
c39e93b527 fix: dev: dns_name_totext() can now resize dynamic buffers
When `dns_name_totext()` is called with a dynamically allocated
target buffer which is too small for the name, it will now resize
the buffer instead of returning `ISC_R_NOSPACE`.

Merge branch 'each-name-totext-resize' into 'main'

See merge request isc-projects/bind9!11289
2025-12-09 21:20:06 +00:00
Evan Hunt
4236d6a325 dns_name_totext() can now resize dynamic buffers
When dns_name_totext() is called with a dynamically allocated
target buffer which is too small for the name, it will resize
the buffer instead of returning ISC_R_NOSPACE.
2025-12-09 12:26:30 -08:00
Ondřej Surý
a3c703ac1c chg: usr: Add more information to the rndc recursing output about fetches
This adds more information about the active fetches for debugging and diagnostic purposes.

Merge branch 'ondrej/provide-more-information-in-dns_resolver_dumpfetches' into 'main'

See merge request isc-projects/bind9!11305
2025-12-09 17:33:26 +01:00
Ondřej Surý
23ae5544be
Add more information to the rndc recursing output about fetches
It is possible to have a fetch that is active, but it has been cloned,
so it won't be used when found in the hash table.   The fetch options
also prevent matching in the hash table, so add a hexadecimal dump of
the fctx->options to the output.
2025-12-09 17:31:45 +01:00
Nicki Křížek
0c0b2819ed chg: test: Convert all named.conf in system tests to jinja2
Replace all the `named.conf*.in` files to use jinja2 templates instead. This makes it possible to drop the `copy_setports` function, makes room for further `setup.sh` cleanup, and prepares for future de-duplication of the configs (common settings as well as shared configs within one test dir).

Merge branch 'nicki/convert-to-jinja2-templates' into 'main'

See merge request isc-projects/bind9!11332
2025-12-09 14:27:31 +01:00
Nicki Křížek
8f326a7af7 Fix a timing issue in notify test
There are a total of 22 notifies required before the start of the test:
20 for each x1..x20 and two for x21, as it has a couple of servers.
2025-12-09 14:23:17 +01:00
Nicki Křížek
51ab74db10 Remove obsolete copy_setports
This function is no longer needed and jinja2 templates are universally
used instead.
2025-12-09 14:23:17 +01:00
Nicki Křížek
bf694d0628 Use jinja2 templates in kasp test
- ns3 had fips/rsasha1 config variants. These were refactored similarly
  to the way they're handled in nsec3 test.
- ns3 special character zone contains @, which is interpreted by jinja2.
  To avoid, {% raw %} directive was added
- ns6 contained unused policies and named2.conf, these were removed
2025-12-09 14:23:17 +01:00
Nicki Křížek
a8713fdcf8 Use jinja2 templates in serve-stale test
The ns1 named.conf files were sufficiently similar to allow for
de-duplication. No attempt to de-duplicate ns3 was made due to
significant differences among the config files.
2025-12-09 14:23:17 +01:00
Nicki Křížek
6114444007 Use jinja2 templates in catz test
- Use a common ns2/named.conf.j2 template for all the "#TN"
  replacements. Instead of commenting out with sed, render the template
  differently into ns/namedX.conf using variables.
- Keep the final ns2/named7.conf.j2 (formerly ns2/named2.conf.in) as a
  separate template for readability due to significant differences.
2025-12-09 14:23:17 +01:00
Nicki Křížek
c93733263a Use jinja2 templates in rpz test
- The ns3/named.conf.j2 uses has a "#BAD" section that is only included
  after restart. Turn it into ns3/named2.conf.
- Since the original config is then restored, keep a copy of it as
  ns3/named1.conf using a symlink, causing it to be rendered twice.
- Use jinja2 templates for test* files to render the port number instead
  of calling copy_setports in load_db().
2025-12-09 14:23:17 +01:00
Nicki Křížek
efc302b0ad Use jinja2 templates in staticstub test
- Instead of strings to be replaced by sed, use proper jinja templates.
- ns3/named1.conf.j2 is basically a copy of the default config, because
  it needs to be restored later in the test.
2025-12-09 14:23:17 +01:00
Nicki Křížek
c46208ffdb Use jinja2 templates in resolver test
- Move ns1/named.conf.j2 to ns1/named2.conf.j2 and adjust the python
  test to render this template.
- Convert remaining .in files to .j2 and handle the multiple configs.
2025-12-09 14:23:17 +01:00
Nicki Křížek
2592f0d961 Use jinja2 templates in views test
- Rename named.conf.j2 to named3.conf.j2 and adjust the python test to
  render this template.
- Handle the n2 and ns3 multiple configs as in other similar cases
  (ns2/named1.conf.in was moved to ns2/named.conf.j2).
2025-12-09 14:23:17 +01:00
Nicki Křížek
1da733a015 Use jinja2 templates in legacy test
The test uses a second named2.conf template. It only differs by using
dnssec-validation yes. Render both named configs and swap them when
needed.
2025-12-09 14:23:17 +01:00
Nicki Křížek
cb88d1eda6 Use jinja2 templates in statistics test
- Merge ns*/statistics-channels.conf.in config snippets into
  conditionally rendered section in ns*/named.conf.j2 files.
- Turn ns2/named.conf.in into ns2/named1.conf.j2 because it is used
  later in the test to restore the original config.
- Symlink the ns2/named.conf.j2 ns2/named1.conf.j2 to pick a starting
  config.
2025-12-09 14:23:17 +01:00
Nicki Křížek
719c656d2b Use jinja2 templates in synthfromdnssec test
- Merge ns*/statistics-channels.conf.in config snippets into
  conditionally rendered section in ns*/named.conf.j2 files.
2025-12-09 14:23:14 +01:00
Nicki Křížek
8db37ac31c Use jinja2 templates in tsig test
- Rename ns1/named-fips.conf.in to ns1/named.conf.j2.
- Move MD5-specific stuff into ns1/named-md5.conf.j2 and include it
  conditionally.
2025-12-09 14:23:14 +01:00
Nicki Křížek
16e9ac4710 Use jinja2 templates in rpzrecurse test
- Change ns2 header into jinja2 template.
- Keep the various ns2 config files as non-templates, same for the
  named.default.conf to be consistent.
- Symlink the ns2/named.default.conf as a jinja2 template to pick a
  starting config. It is rendered as a template to avoid an error when
  the test would overwrite a git-tracked file.
- Use jinja2 templates for the ns3 files, keep named1.conf around
  because it's needed later in the test to restore the config. Symlink
  it to `ns3/named.conf.j2` to select a default config.
2025-12-09 14:23:14 +01:00
Nicki Křížek
54c95d6966 Use jinja2 templates in nsupdate test
- Merge ns1/tls.options.in into ns1/named.conf.j2 and render it
  conditionally. Also conditionally include the additional
  ns1/tls.conf.j2 which is always rendered.
- Use multiple templates for ns7 and replace the copy_setports.
- Use jinja2 template for verylarge.in as well.
2025-12-09 14:23:14 +01:00
Nicki Křížek
9fc446b6f5 Use jinja2 templates in notify test
- Merge options-tls.conf into named.conf in ns2 and ns4 and render it
  conditionally. Also conditionally include the additional
  named-tls.conf which is always rendered.
2025-12-09 14:23:14 +01:00
Nicki Křížek
8e525f2154 Use jinja2 templates in forward test
- Merge options-tls.conf into named.conf in ns2 and ns4 and render it
  conditionally. Also conditionally include the additional
  named-tls.conf which is always rendered.
- Use multiple templates for ns3 and ns9 and replace the copy_setports.
- In ns3/named2.conf, use "root2.db" directly rather than replacing it
  with "sed" later.
2025-12-09 14:23:14 +01:00
Nicki Křížek
3f953266fb Use jinja2 templates in logfileconf test
- Replace all named*.in files with jinja2 templates.
- Rename the config files to named.*.conf convention.
- Rename named.plain.in to named.plain.conf.j2 and symlink it as te
  default config.
- Rename named.plainconf.in to named.plainlog.conf.j2 (there is a slight
  difference from named.plain, despite the similar name)
2025-12-09 14:23:14 +01:00
Nicki Křížek
7f3b0afb09 Use jinja2 templates in runtime test
- Replace named-altX.conf.in with namedX.conf.j2 to stick with the same
  naming convention across the entire code base. Note than due to
  named1.conf being the first (default) config, the numbers for the altX
  are incremented.
- Turn alt9 into named7 to stick with the same number sequence. Adjust
  the related file names accordingly.
2025-12-09 14:23:14 +01:00
Nicki Křížek
b23301ec55 Use jinja2 templates in checkzone test
Render the bad-tsig.db file using jinja2 template to get rid of
copy_setports.

Since the zone is using @ character, use the raw directive to avoid
interpreting it as a variable start.
2025-12-09 14:23:14 +01:00
Nicki Křížek
13bd0d689a Use jinja2 templates in autosign test
- Include ns3/nsec-only.conf conditionally and always render it.
2025-12-09 14:23:14 +01:00
Nicki Křížek
1aa2f7249a Use jinja2 templates in tsiggss
- The ns1/named.conf.j2 contains "@" which is a special jinja character,
  use the raw directive to escape it.
2025-12-09 14:23:14 +01:00
Nicki Křížek
0f37603b1a Use jinja2 templates in transport-change test
- Replace named*.conf.in files with jinja2 templates.
- When applying the files use plain cp command to copy the rendered
  files.
2025-12-09 14:23:14 +01:00
Nicki Křížek
9d3279a542 Replace .in with .j2 templates for cases with namedX.conf
The following tests use multiple named configs. Previously, these have
been rendered with copy_setports in tests.sh when needed. Transform
these into jinja2 templates and render them during setup. In the tests,
the copy_setports invocations can be then replaced with a simple cp.
2025-12-09 14:23:14 +01:00
Nicki Křížek
fc10cb686d Replace .in with .j2 templates for simple copy_setports cases
Use jinja2 templates instead of *.in templates for named.conf and remove
the copy_setports invocations from setup.sh which are no longer needed.
2025-12-09 14:23:14 +01:00
Nicki Křížek
d6d6db52e3 Allow any named*.conf file as a system test artifact
This allows rendering multiple named*.conf files using the jinja2
template engine at test start and then simply copying the required
config to named.conf as needed.
2025-12-09 14:23:14 +01:00
Alessio Podda
c47239985b fix: usr: Resolve "Inbound IXFR performance regression between 9.18.31 and 9.20.9"
This MR adds add some specialized logic to handle IXFR in qpzone, avoiding the need to have one qp transaction per rdataset. 

We do this in multiple steps:
 - We extend dns_rdatacallbacks_t vtable to allow subtraction and resigning.
 - We add a new set of api (begin|commit|abort)update to the dbmethods vtable. These API model an incremental update that can be aborted, and make diff apply use these functions instead of adding the rdatasets directly to the database.
 - We add a specialization of dns_rdatacallbacks_t to qpzone that uses a single qp transaction for the entire IXFR. 

With this batch API, we see performance improvements over adding one rdataset at a time.

Closes #5442

Merge branch '5442-ixfr-batch-transaction' into 'main'

See merge request isc-projects/bind9!11077
2025-12-09 13:06:03 +00:00
Alessio Podda
ad0a382092 Fix formatting
Cleanup formatting after IXFR changes.
2025-12-09 13:32:24 +01:00