Commit Graph

38675 Commits

Author SHA1 Message Date
Ondřej Surý
79ee08c337 Add CHANGES and release note for [GL #4621] 2024-03-06 17:11:14 +01:00
Ondřej Surý
79040a669c Move the task creation into cache_create_db()
The dns_cache_flush() drops the old database and creates a new one, but
it forgets to create the task(s) that runs the node pruning and cleaning
the rbtdb when flushing it next time.  This causes the cleaning to skip
cleaning the parent nodes (with .down == NULL) leading to increased
memory usage over time until the database is unable to keep up and just
stays overmem all the time.
2024-03-06 17:11:14 +01:00
Ondřej Surý
231b2375e5 Create a second pruning task for rbtdb with unlimited quantum
Previously, rbtdb->task had quantum of 1 because it was originally used
just for freeing RBTDB contents, which can happen on a "best effort"
basis (does not need to be prioritized).  However, when tree pruning was
implemented, it also started sending events to that task, enabling the
latter to become clogged up with a significant event backlog because it
only pruned a single RBTDB node per event.

To prioritize tree pruning (as it is necessary for enforcing the
configured memory use limit for the cache memory context), create a
second task with a virtually unlimited quantum (UINT_MAX) and send the
tree-pruning events to this new task, to ensure that all nodes scheduled
for pruning will be processed before further nodes are queued in a
similar fashion.

This change enables dropping the prunenodes list and restoring the
originally-used logic that allocates and sends a separate event for each
node to prune.
2024-03-06 17:11:14 +01:00
Ondřej Surý
3a01c749f9 Restore the parent cleaning logic in prune_tree()
Reconstruct the variant of the prune_tree() parent cleaning to consider
all elibible parents in a single loop as we were doing before all the
changes that led to this commit.

Update code comments so that they more precisely describe what the
relevant bits of code actually do.

(cherry picked from commit 454c75a33a)
2024-03-06 17:11:14 +01:00
Evan Hunt
dad3ea96e9 Merge branch 'each-move-rrl-broken-config-test-case-to-checkconf-bind-9.18' into 'bind-9.18'
[9.18] Move RRL broken-config check to checkconf

See merge request isc-projects/bind9!8812
2024-03-02 00:31:53 +00:00
Evan Hunt
046b62bf02 move RRL broken-config check to checkconf
the RRL test included a test case that tried to start named with
a broken configuration.  the same error could be found with
named-checkconf, so it should have been tested in the checkconf
system test.

(cherry picked from commit 05398c1488)
2024-03-01 15:59:38 -08:00
Ondřej Surý
a5a094c0af Merge branch '4591-improve-ttl-based-cleaning-9.18' into 'bind-9.18'
[9.18] Remove expired rdataset headers from the heap

See merge request isc-projects/bind9!8755
2024-02-29 15:08:38 +00:00
Ondřej Surý
9584c4338e Add CHANGES note for [GL #4591]
(cherry picked from commit db69cc7891)
2024-02-29 16:07:42 +01:00
Ondřej Surý
b4d9f1cbab Make the TTL-based cleaning more aggressive
It was discovered that the TTL-based cleaning could build up
a significant backlog of the rdataset headers during the periods where
the top of the TTL heap isn't expired yet.  Make the TTL-based cleaning
more aggressive by cleaning more headers from the heap when we are
adding new header into the RBTDB.

(cherry picked from commit d8220ca4ca)
2024-02-29 16:07:41 +01:00
Ondřej Surý
756555dbcf Remove expired rdataset headers from the heap
It was discovered that an expired header could sit on top of the heap
a little longer than desireable.  Remove expired headers (headers with
rdh_ttl set to 0) from the heap completely, so they don't block the next
TTL-based cleaning.

(cherry picked from commit a9383e4b95)
2024-02-29 16:07:41 +01:00
Ondřej Surý
efdfc8d87f Merge branch '4596-regression-in-cache-cleaning-9.18' into 'bind-9.18'
[9.18] Remove the contention when pruning RBTDB nodes

See merge request isc-projects/bind9!8766
2024-02-29 11:38:54 +00:00
Ondřej Surý
f255ab3bf7 Add CHANGES and release note for [GL #4596]
(cherry picked from commit f447557667)
2024-02-29 12:06:56 +01:00
Ondřej Surý
a4c225cb6d Simplify the parent cleaning in the prune_tree() mechanism
Instead of juggling with node locks in a cycle, cleanup the node we are
just pruning and send any the parent that's also subject to the pruning
to the prune tree via normal way (e.g. enqueue pruning on the parent).

This simplifies the code and also spreads the pruning load across more
event loop ticks which is better for lock contention as less things run
in a tight loop.

(cherry picked from commit 0b32d323e0)
2024-02-29 12:06:56 +01:00
Ondřej Surý
4b32456705 Reduce lock contention during RBTDB tree pruning
The log message for commit a9af1ac5ae
explained:

    In some older BIND 9 branches, the extra queuing overhead eliminated by
    this change could be remotely exploited to cause excessive memory use.
    Due to architectural shift, this branch is not vulnerable to that issue,
    but applying the fix to the latter is nevertheless deemed prudent for
    consistency and to make the code future-proof.

However, it turned out that having a single queue for the nodes to be
pruned increased lock contention to a level where cleaning up nodes from
the RBTDB took too long, causing the amount of memory used by the cache
to grow indefinitely over time.

This commit reverts the change to the pruning mechanism introduced by
commit a9af1ac5ae as BIND branches newer
than 9.16 were not affected by the excessive event queueing overhead
issue mentioned in the log message for the above commit.

(cherry picked from commit eed17611d8)
2024-02-29 12:06:56 +01:00
Artem Boldariev
71b0d1ba3f Merge branch '4156-docs-ephemeral-tls-recreation-v9.18' into 'bind-9.18'
[9.18] Improve documentation on ephemeral TLS configuration

See merge request isc-projects/bind9!8793
2024-02-28 21:28:57 +00:00
Artem Boldariev
9e6b4334ef Improve documentation on ephemeral TLS configuration
This commit improves the documentation on the ephemeral TLS
configuration and describes in more detail what is happening with TLS
configurations on reconfiguration in general.

(cherry picked from commit 1ab0f6d918)
2024-02-28 22:57:25 +02:00
Mark Andrews
4237921a05 Merge branch '4604-fix-initial-tests-in-masterfile-system-test-bind-9.18' into 'bind-9.18'
[9.18] Resolve "Fix initial tests in masterfile system test"

See merge request isc-projects/bind9!8788
2024-02-28 01:21:20 +00:00
Mark Andrews
111abe9940 Split the first masterfile test into 3
Additionally read the correct zone for BIND 8 ttl checks

(cherry picked from commit e02b73c7a4)
2024-02-28 11:38:18 +11:00
Aydın Mercan
d2542a38ed Merge branch '4425-current-level-of-tcp-clients-missing-from-statistics-channel-v9_18' into 'bind-9.18'
[9.18] Expose the TCP client count in statistics channel

See merge request isc-projects/bind9!8660
2024-02-27 08:40:34 +00:00
Aydın Mercan
2cfb92439b Add CHANGES and release note for [GL #4425]
(cherry picked from commit cc2713700a)
2024-02-27 11:04:28 +03:00
Aydın Mercan
abc47f5ce4 Expose the TCP client count in statistics channel
The statistics channel does not expose the current number of TCP clients
connected, only the highwater. Therefore, users did not have an easy
means to collect statistics about TCP clients served over time. This
information could only be measured as a seperate mechanism via rndc by
looking at the TCP quota filled.

In order to expose the exact current count of connected TCP clients
(tracked by the "tcp-clients" quota) as a statistics counter, an
extra, dedicated Network Manager callback would need to be
implemented for that purpose (a counterpart of ns__client_tcpconn()
that would be run when a TCP connection is torn down), which is
inefficient. Instead, track the number of currently-connected TCP
clients separately for IPv4 and IPv6, as Network Manager statistics.

(cherry picked from commit 2690dc48d3)
2024-02-27 11:04:28 +03:00
Michal Nowak
56c37ca845 Merge branch 'mnowak/dialup-watch-log-from-start-9.18' into 'bind-9.18'
[9.18] Watch logs from start in dialup system test

See merge request isc-projects/bind9!8785
2024-02-26 12:02:17 +00:00
Michal Nowak
195b892bde Watch logs from start in dialup system test
When the first parametrized test takes a bit longer than usual, the zone
transfer in ns3 may succeed before the second parametrized test is even
started, and then watch_log_from_here() won't find the "Transfer status:
success" message in the named log. Using watch_log_from_start() instead
makes sure the test is more stable.

(cherry picked from commit 283a7ab17d)
2024-02-26 12:11:07 +01:00
Mark Andrews
0356a34673 Merge branch '4413-add-resinfo-261-type-to-named-bind-9.18' into 'bind-9.18'
[9.18] Resolve "Add RESINFO (261) type to named" !8464

See merge request isc-projects/bind9!8783
2024-02-26 02:58:40 +00:00
Mark Andrews
fefea3bc92 Add CHANGES entry for [GL #4413]
(cherry picked from commit 1bf03a2e9a)
2024-02-26 13:21:21 +11:00
Mark Andrews
2e224d46d2 Add RESINFO record type
This is a TXT clone using code point 261.

(cherry picked from commit 0651063658)
2024-02-26 13:20:48 +11:00
Michal Nowak
5138f7bbde Merge branch 'mnowak/pytest_rewrite_dsdigest-9.18' into 'bind-9.18'
[9.18] Rewrite dsdigest system test to pytest

See merge request isc-projects/bind9!8781
2024-02-23 13:52:45 +00:00
Michal Nowak
05416a52b8 Rewrite dsdigest system test to pytest
(cherry picked from commit cfb68bda79)
2024-02-23 14:19:22 +01:00
Michal Nowak
f4f7827cf9 Add isctest.check.servfail()
(cherry picked from commit 5830ac831f)
2024-02-23 14:19:18 +01:00
Michal Nowak
a16a210d1c Merge branch 'mnowak/pytest_rewrite_xferquota-9.18' into 'bind-9.18'
[9.18] Rewrite xferquota system test to pytest

See merge request isc-projects/bind9!8775
2024-02-23 12:15:08 +00:00
Michal Nowak
07bd58d836 Rewrite xferquota system test to pytest
(cherry picked from commit 69bf4432cc)
2024-02-23 11:49:47 +01:00
Michal Nowak
b54455e43e Add isctest.check.rrsets_equal function
(cherry picked from commit 1e52a11343)
2024-02-23 11:49:43 +01:00
Michal Nowak
474eb35d59 Add retry_with_timeout() utility function
(cherry picked from commit 5694c52f52)
2024-02-23 11:49:38 +01:00
Michal Nowak
eeaf17f5d4 Add RegEx support to wait_for_line() and wait_for_lines()
(cherry picked from commit 6dd1b3ab38)
2024-02-23 11:49:34 +01:00
Michal Nowak
e83d28a9a4 Merge branch 'mnowak/pytest_rewrite_sortlist-9.18' into 'bind-9.18'
[9.18] Rewrite sortlist system test to pytest

See merge request isc-projects/bind9!8774
2024-02-23 10:35:55 +00:00
Michal Nowak
0e92b14cce Make pytest a bit more verbose
The "-vv" option gives us full untruncated diffs of compared data
strustures.

(cherry picked from commit bcbe34e22d)
2024-02-23 10:59:09 +01:00
Michal Nowak
b7bc0e8117 Rewrite sortlist system test to pytest
(cherry picked from commit e7b5cf7f79)
2024-02-23 10:59:05 +01:00
Michal Nowak
16f950e86b Support "source" parameter in isctest.query.(tcp|udp)
(cherry picked from commit 4a203dcb93)
2024-02-23 10:59:01 +01:00
Tom Krizek
8fb49c5a8a Merge branch 'tkrizek/pytest-log-9.18' into 'bind-9.18'
[9.18] Simplify pytest logging

See merge request isc-projects/bind9!8748
2024-02-16 15:35:01 +00:00
Tom Krizek
b27ac8d1bd Don't include temp testdir on each log line
This was mostly an artifact to tell which log lines belong to which test
from the time when the test output could be all mingled together. Now
this info is reduntant, because the pytest logger already includes both
the system test name, and the specific test.

(cherry picked from commit 8058140b67)
2024-02-16 16:03:53 +01:00
Tom Krizek
51bd0f2949 Add utility logging functions to isctest.log
Unify the different loggers (conftest, module, test) into a single
interface. Remove the need to select the proper logger by automatically
selecting the most-specific logger currently available.

This also removes the need to use the logger/mlogger fixtures manually
and pass these around. This was especially annoying and unwieldy when
splitting the test cases into functions, because logger had to always be
passed around. Instead, it is now possible to use the
isctest.log.(debug,info,warning,error) functions.

(cherry picked from commit c60975f108)
2024-02-16 16:03:50 +01:00
Tom Krizek
7a1869c23f Move watchlog module into isctest.log package
Preparation for further logging improvements - keep the watchlog
contents in a separate module inside isctest.log. Export the names in
the log package so the imports don't change for the users of these
classes.

(cherry picked from commit 52f9e6f557)
2024-02-16 16:01:09 +01:00
Tom Krizek
1f987a6c49 Remove accidentally duplicated RNDCExecutor code
This code has probably been accidentally added during some rebase. The
actual RNDCExecutor and related classes are in isctest/rndc.py. Remove
the duplicated and unused code from isctest/log.py, as it doesn't belong
there.

(cherry picked from commit f8fa528cdd)
2024-02-16 16:01:07 +01:00
Evan Hunt
0e361227c1 Merge branch 'each-rbtdb-dbiterator-fixes-bind-9.18' into 'bind-9.18'
[9.18] fix several bugs in the RBTDB dbiterator implementation

See merge request isc-projects/bind9!8743
2024-02-15 20:11:01 +00:00
Evan Hunt
198c6bc22e CHANGES for [GL !8741]
(cherry picked from commit 32241022b5)
2024-02-15 11:34:34 -08:00
Evan Hunt
fe05278424 fix several bugs in the RBTDB dbiterator implementation
- the DNS_DB_NSEC3ONLY and DNS_DB_NONSEC3 flags are mutually
  exclusive; it never made sense to set both at the same time.
  to enforce this, it is now a fatal error to do so.  the
  dbiterator implementation has been cleaned up to remove
  code that treated the two as independent: if nonsec3 is
  true, we can be certain nsec3only is false, and vice versa.
- previously, iterating a database backwards omitted
  NSEC3 records even if DNS_DB_NONSEC3 had not been set. this
  has been corrected.
- when an iterator reaches the origin node of the NSEC3 tree, we
  need to skip over it and go to the next node in the sequence.
  the NSEC3 origin node is there for housekeeping purposes and
  never contains data.
- the dbiterator_test unit test has been expanded, several
  incorrect expectations have been fixed. (for example, the
  expected number of iterations has been reduced by one; we were
  previously counting the NSEC3 origin node and we should not
  have been doing so.)

(cherry picked from commit e40fd4ed06)
2024-02-15 11:34:34 -08:00
Michał Kępień
fc16701eef Merge branch 'michal/post-release-tweaks-9.18' into 'bind-9.18'
[9.18] Miscellaneous post-release tweaks

See merge request isc-projects/bind9!8739
2024-02-14 16:23:09 +00:00
Michał Kępień
6a40a5eada Mention CVE-2023-50868 in CHANGES entry 6322
Since CVE-2023-50868 does not have a dedicated fix in BIND 9, mention
its CVE identifier in the CHANGES entry for CVE-2023-50387 (KeyTrap),
which accompanied the code change that addresses both of these
vulnerabilities.

(cherry picked from commit 2fd20bbaf5)
2024-02-14 17:17:49 +01:00
Michal Nowak
67e322b980 Merge branch 'mnowak/accommodate-black-24.2.0-9.18' into 'bind-9.18'
[9.18] Accommodate black 24.2.0

See merge request isc-projects/bind9!8734
2024-02-14 14:46:22 +00:00
Michal Nowak
60c5f6f972 Accommodate black 24.2.0
(cherry picked from commit 70163a8b3f)
2024-02-14 15:45:17 +01:00