Compare commits

...

11 Commits

Author SHA1 Message Date
Evan Hunt
40c8a04fe0 fixup! Add .up pointer to slabheader 2025-02-13 15:27:26 -08:00
Ondřej Surý
d7c329f79d Add .up pointer to slabheader 2025-02-13 15:27:25 -08:00
Michal Nowak
bd4729e13b chg: test: Rewrite nzd2nzf system test to pytest
Merge branch 'mnowak/pytest_rewrite_nzd2nzf' into 'main'

See merge request isc-projects/bind9!9160
2025-02-13 18:29:07 +00:00
Michal Nowak
38e751d9ac Rename assert_custom_named_is_alive to named_alive 2025-02-13 18:43:47 +01:00
Michal Nowak
7c499d1689 Rewrite nzd2nzf system test to pytest 2025-02-13 18:43:47 +01:00
Michal Nowak
42a7b6aedf chg: test: Rewrite names system test to pytest
Merge branch 'mnowak/pytest_rewrite_names' into 'main'

See merge request isc-projects/bind9!8759
2025-02-13 16:56:31 +00:00
Michal Nowak
5250ad8720 Rewrite names system test to pytest
dnspython 2.7.0 or newer is needed because of wire().
2025-02-13 16:55:38 +00:00
Michal Nowak
7b3dc7ab32 chg: test: Generate TSAN unit stress tests
This is a complement to the already present system test "stress" test.

Merge branch 'mnowak/generate-tsan-unit-stress-tests' into 'main'

See merge request isc-projects/bind9!9474
2025-02-13 16:40:25 +00:00
Michal Nowak
a03c4b4cf9 Generate TSAN unit stress tests 2025-02-13 16:39:27 +00:00
Andoni Duarte
3d3247109c chg: doc: Set up version for BIND 9.21.6
Merge branch 'andoni/set-up-version-for-bind-9.21.6' into 'main'

See merge request isc-projects/bind9!10093
2025-02-13 16:10:39 +00:00
Andoni Duarte Pintado
259678df11 Update BIND version to 9.21.6-dev 2025-02-13 15:55:46 +01:00
17 changed files with 222 additions and 311 deletions

View File

@@ -102,6 +102,12 @@ def is_executable(cmd: str, errmsg: str) -> None:
assert executable is not None, errmsg
def named_alive(named_proc, resolver_ip):
assert named_proc.poll() is None, "named isn't running"
msg = dns.message.make_query("version.bind", "TXT", "CH")
isctest.query.tcp(msg, resolver_ip, expected_rcode=dns_rcode.NOERROR)
def notauth(message: dns.message.Message) -> None:
rcode(message, dns.rcode.NOTAUTH)

View File

@@ -49,6 +49,10 @@ with_libxml2 = pytest.mark.skipif(
not feature_test("--have-libxml2"), reason="libxml2 support disabled in the build"
)
with_lmdb = pytest.mark.skipif(
not feature_test("--with-lmdb"), reason="LMDB support disabled in the build"
)
with_json_c = pytest.mark.skipif(
not feature_test("--have-json-c"), reason="json-c support disabled in the build"
)

View File

@@ -16,9 +16,6 @@ import time
from typing import List, Optional
import isctest.log
from isctest.compat import dns_rcode
import dns.message
def cmd(
@@ -135,9 +132,3 @@ def get_named_cmdline(cfg_dir, cfg_file="named.conf"):
named_cmdline = [named, "-c", cfg_file, "-d", "99", "-g"]
return named_cmdline
def assert_custom_named_is_alive(named_proc, resolver_ip):
assert named_proc.poll() is None, "named isn't running"
msg = dns.message.make_query("version.bind", "TXT", "CH")
isctest.query.tcp(msg, resolver_ip, expected_rcode=dns_rcode.NOERROR)

View File

@@ -1,51 +0,0 @@
#!/bin/sh
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
set -e
. ../conf.sh
DIGOPTS="+nosea +stat +noquest +nocomm +nocmd -p ${PORT}"
status=0
echo_i "Getting message size with compression enabled"
$DIG $DIGOPTS -b 10.53.0.1 @10.53.0.1 mx example >dig.compen.test || ret=1
COMPEN=$(grep ';; MSG SIZE' dig.compen.test | sed -e "s/.*: //g")
cat dig.compen.test | grep -v ';;' | sort >dig.compen.sorted.test
echo_i "Getting message size with compression disabled"
$DIG $DIGOPTS -b 10.53.0.2 @10.53.0.1 mx example >dig.compdis.test || ret=1
COMPDIS=$(grep ';; MSG SIZE' dig.compdis.test | sed -e "s/.*: //g")
cat dig.compdis.test | grep -v ';;' | sort >dig.compdis.sorted.test
# the compression disabled message should be at least twice as large as with
# compression disabled, but the content should be the same
echo_i "Checking if responses are identical other than in message size"
{
diff dig.compdis.sorted.test dig.compen.sorted.test >/dev/null
ret=$?
} || true
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
echo_i "Checking if message with compression disabled is significantly larger"
echo_i "Disabled $COMPDIS vs enabled $COMPEN"
val=$(((COMPDIS * 3 / 2) / COMPEN))
if [ $val -le 1 ]; then
echo_i "failed"
status=$((status + 1))
fi
echo_i "exit status: $status"
[ $status -eq 0 ] || exit 1

View File

@@ -0,0 +1,33 @@
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
import pytest
pytest.importorskip("dns", minversion="2.7.0")
import dns.message
import isctest
# The query answer sent with compression disabled should have a size that is
# about twice as large as the answer with compression enabled, while
# maintaining identical content.
def test_names():
msg = dns.message.make_query("example.", "MX")
# Getting message size with compression enabled
res_enabled = isctest.query.tcp(msg, ip="10.53.0.1", source="10.53.0.1")
# Getting message size with compression disabled
res_disabled = isctest.query.tcp(msg, ip="10.53.0.1", source="10.53.0.2")
# Checking if responses are identical content-wise
isctest.check.rrsets_equal(res_enabled.answer, res_disabled.answer)
# Checking if message with compression disabled is significantly (say 70%) larger
assert len(res_disabled.wire) > len(res_enabled.wire) * 1.7

View File

@@ -1,22 +0,0 @@
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
import pytest
pytestmark = pytest.mark.extra_artifacts(
[
"dig.*.test*",
]
)
def test_names(run_tests_sh):
run_tests_sh()

View File

@@ -1,20 +0,0 @@
#!/bin/sh
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. ../conf.sh
$FEATURETEST --with-lmdb || {
echo_i "This test requires LMDB support." >&2
exit 255
}
exit 0

View File

@@ -1,85 +0,0 @@
#!/bin/sh
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
set -e
. ../conf.sh
dig_with_opts() {
"$DIG" -p "${PORT}" "$@"
}
rndccmd() {
"$RNDC" -c ../_common/rndc.conf -p "${CONTROLPORT}" -s "$@"
}
status=0
n=0
n=$((n + 1))
echo_i "querying for non-existing zone data ($n)"
ret=0
dig_with_opts @10.53.0.1 a.added.example a >dig.out.ns1.$n || ret=1
grep 'status: REFUSED' dig.out.ns1.$n >/dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
n=$((n + 1))
echo_i "adding a new zone into default NZD using rndc addzone ($n)"
rndccmd 10.53.0.1 addzone 'added.example { type primary; file "added.db"; };' 2>&1 | sed 's/^/I:ns1 /' | cat_i
sleep 2
n=$((n + 1))
echo_i "querying for existing zone data ($n)"
ret=0
dig_with_opts @10.53.0.1 a.added.example a >dig.out.ns1.$n || ret=1
grep 'status: NOERROR' dig.out.ns1.$n >/dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
echo_i "stopping ns1"
stop_server ns1
n=$((n + 1))
echo_i "dumping _default.nzd to _default.nzf ($n)"
$NZD2NZF ns1/_default.nzd >ns1/_default.nzf || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
n=$((n + 1))
echo_i "checking that _default.nzf contains the expected content ($n)"
grep 'zone "added.example" { type primary; file "added.db"; };' ns1/_default.nzf >/dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
echo_i "deleting _default.nzd database"
rm -f ns1/_default.nzd
echo_i "starting ns1 which should migrate the .nzf to .nzd"
start_server --noclean --restart --port ${PORT} ns1
n=$((n + 1))
echo_i "querying for zone data from migrated zone config ($n)"
# retry loop in case the server restart above causes transient failures
_do_query() (
dig_with_opts @10.53.0.1 a.added.example a >dig.out.ns1.$n \
&& grep 'status: NOERROR' dig.out.ns1.$n >/dev/null
)
ret=0
retry_quiet "10" _do_query || ret=1
n=$((n + 1))
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
echo_i "exit status: $status"
exit $status

View File

@@ -0,0 +1,66 @@
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
import os
import pytest
import isctest
import isctest.mark
import isctest.run
import dns.message
pytestmark = [
isctest.mark.with_lmdb,
pytest.mark.extra_artifacts(
["ns1/_default.nzd", "ns1/_default.nzf~"],
),
]
def test_nzd2nzf(servers):
zone_data = '"added.example" { type primary; file "added.db"; };'
msg = dns.message.make_query("a.added.example.", "A")
# query for non-existing zone data
res = isctest.query.tcp(msg, servers["ns1"].ip)
isctest.check.refused(res)
# add new zone into the default NZD using "rndc addzone"
servers["ns1"].rndc(f"addzone {zone_data}", log=False)
# query for existing zone data
res = isctest.query.tcp(msg, servers["ns1"].ip)
isctest.check.noerror(res)
servers["ns1"].stop()
# dump "_default.nzd" to "_default.nzf" and check that it contains the expected content
cfg_dir = "ns1"
stdout = isctest.run.cmd(
[os.environ["NZD2NZF"], "_default.nzd"], cwd=cfg_dir
).stdout.decode("utf-8")
assert f"zone {zone_data}" in stdout
nzf_filename = os.path.join(cfg_dir, "_default.nzf")
with open(nzf_filename, "w", encoding="utf-8") as nzf_file:
nzf_file.write(stdout)
# delete "_default.nzd" database
nzd_filename = os.path.join(cfg_dir, "_default.nzd")
os.remove(nzd_filename)
# start ns1 again, it should migrate "_default.nzf" to "_default.nzd"
servers["ns1"].start(["--noclean", "--restart", "--port", os.environ["PORT"]])
# query for zone data from the migrated zone config
res = isctest.query.tcp(msg, servers["ns1"].ip)
isctest.check.noerror(res)

View File

@@ -1,24 +0,0 @@
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
import pytest
pytestmark = pytest.mark.extra_artifacts(
[
"dig.out.*",
"ns*/*.nzd",
"ns*/*.nzf*",
]
)
def test_nzd2nzf(run_tests_sh):
run_tests_sh()

View File

@@ -177,7 +177,7 @@ def test_named_shutdown(kill_method):
named_cmdline, cwd=cfg_dir, stderr=named_log
) as named_proc:
try:
isctest.run.assert_custom_named_is_alive(named_proc, resolver_ip)
isctest.check.named_alive(named_proc, resolver_ip)
do_work(
named_proc,
resolver_ip,

View File

@@ -16,7 +16,7 @@
#
m4_define([bind_VERSION_MAJOR], 9)dnl
m4_define([bind_VERSION_MINOR], 21)dnl
m4_define([bind_VERSION_PATCH], 5)dnl
m4_define([bind_VERSION_PATCH], 6)dnl
m4_define([bind_VERSION_EXTRA], -dev)dnl
m4_define([bind_DESCRIPTION], [(Development Release)])dnl
m4_define([bind_SRCID], [m4_esyscmd_s([git rev-parse --short HEAD | cut -b1-7])])dnl

View File

@@ -102,12 +102,16 @@ struct dns_slabheader {
* both head and tail pointers, and is doubly linked.
*/
struct dns_slabheader *next;
union {
struct dns_slabheader *next;
struct dns_slabheader *up;
};
/*%<
* If this is the top header for an rdataset, 'next' points
* to the top header for the next rdataset (i.e., the next type).
* Otherwise, it points up to the header whose down pointer points
* at this header.
*
* Otherwise 'up' points up to the header whose down pointer points at
* this header.
*/
struct dns_slabheader *down;
@@ -322,3 +326,9 @@ dns_slabheader_freeproof(isc_mem_t *mctx, dns_slabheader_proof_t **proof);
/*%<
* Free all memory associated with a nonexistence proof.
*/
dns_slabheader_t *
dns_slabheader_top(dns_slabheader_t *header);
/*%<
* Return the top header for the type or the negtype
*/

View File

@@ -3133,7 +3133,7 @@ find_header:
} else {
qpnode->data = newheader;
}
newheader->next = topheader->next;
newheader->next = header->next;
dns_slabheader_destroy(&header);
} else {
idx = HEADERNODE(newheader)->locknum;
@@ -3152,9 +3152,9 @@ find_header:
} else {
qpnode->data = newheader;
}
newheader->next = topheader->next;
newheader->down = topheader;
topheader->next = newheader;
newheader->next = header->next;
newheader->down = header;
header->up = newheader;
mark_ancient(header);
if (sigheader != NULL) {
mark_ancient(sigheader);
@@ -3202,14 +3202,12 @@ find_header:
}
newheader->next = topheader->next;
newheader->down = topheader;
topheader->next = newheader;
topheader->up = newheader;
qpnode->dirty = 1;
} else {
/*
* No rdatasets of the given type exist at the node.
*/
INSIST(newheader->down == NULL);
if (prio_header(newheader)) {
/* This is a priority type, prepend it */
newheader->next = qpnode->data;
@@ -3779,9 +3777,8 @@ rdatasetiter_next(dns_rdatasetiter_t *it DNS__DB_FLARG) {
qpc_rditer_t *iterator = (qpc_rditer_t *)it;
qpcache_t *qpdb = (qpcache_t *)(iterator->common.db);
qpcnode_t *qpnode = (qpcnode_t *)iterator->common.node;
dns_slabheader_t *header = NULL, *top_next = NULL;
dns_typepair_t type, negtype;
dns_rdatatype_t rdtype, covers;
dns_slabheader_t *header = NULL;
dns_slabheader_t *topheader = NULL, *topheader_next = NULL;
isc_rwlocktype_t nlocktype = isc_rwlocktype_none;
isc_rwlock_t *nlock = &qpdb->buckets[qpnode->locknum].lock;
bool expiredok = EXPIREDOK(iterator);
@@ -3793,36 +3790,23 @@ rdatasetiter_next(dns_rdatasetiter_t *it DNS__DB_FLARG) {
NODE_RDLOCK(nlock, &nlocktype);
type = header->type;
rdtype = DNS_TYPEPAIR_TYPE(header->type);
if (NEGATIVE(header)) {
covers = DNS_TYPEPAIR_COVERS(header->type);
negtype = DNS_TYPEPAIR_VALUE(covers, 0);
} else {
negtype = DNS_TYPEPAIR_VALUE(0, rdtype);
}
/*
* Find the start of the header chain for the next type
* by walking back up the list.
* Find the start of the header chain for the next type.
*/
top_next = header->next;
while (top_next != NULL &&
(top_next->type == type || top_next->type == negtype))
{
top_next = top_next->next;
}
if (expiredok) {
topheader = dns_slabheader_top(header);
topheader_next = topheader->next;
if (expiredok && header->down != NULL) {
/*
* Keep walking down the list if possible or
* start the next type.
*/
header = header->down != NULL ? header->down : top_next;
header = header->down;
} else {
header = top_next;
header = topheader->next;
}
for (; header != NULL; header = top_next) {
top_next = header->next;
for (; header != NULL; header = topheader_next) {
topheader_next = header->next;
do {
if (expiredok) {
if (!NONEXISTENT(header)) {
@@ -3841,15 +3825,12 @@ rdatasetiter_next(dns_rdatasetiter_t *it DNS__DB_FLARG) {
if (header != NULL) {
break;
}
/*
* Find the start of the header chain for the next type
* by walking back up the list.
* Find the start of the header chain for the next type.
*/
while (top_next != NULL &&
(top_next->type == type || top_next->type == negtype))
{
top_next = top_next->next;
}
topheader = topheader->next;
header = topheader;
}
NODE_UNLOCK(nlock, &nlocktype);

View File

@@ -775,7 +775,7 @@ qpznode_acquire(qpzonedb_t *qpdb, qpznode_t *node DNS__DB_FLARG) {
static void
clean_zone_node(qpznode_t *node, uint32_t least_serial) {
dns_slabheader_t *current = NULL, *dcurrent = NULL;
dns_slabheader_t *down_next = NULL, *dparent = NULL;
dns_slabheader_t *dcurrent_down = NULL, *dparent = NULL;
dns_slabheader_t *top_prev = NULL, *top_next = NULL;
bool still_dirty = false;
@@ -794,17 +794,17 @@ clean_zone_node(qpznode_t *node, uint32_t least_serial) {
*/
dparent = current;
for (dcurrent = current->down; dcurrent != NULL;
dcurrent = down_next)
dcurrent = dcurrent_down)
{
down_next = dcurrent->down;
dcurrent_down = dcurrent->down;
INSIST(dcurrent->serial <= dparent->serial);
if (dcurrent->serial == dparent->serial ||
IGNORE(dcurrent))
{
if (down_next != NULL) {
down_next->next = dparent;
if (dcurrent_down != NULL) {
dcurrent_down->up = dparent;
}
dparent->down = down_next;
dparent->down = dcurrent_down;
dns_slabheader_destroy(&dcurrent);
} else {
dparent = dcurrent;
@@ -815,9 +815,10 @@ clean_zone_node(qpznode_t *node, uint32_t least_serial) {
* We've now eliminated all IGNORE datasets with the possible
* exception of current, which we now check.
*/
if (IGNORE(current)) {
down_next = current->down;
if (down_next == NULL) {
dcurrent = current;
if (IGNORE(dcurrent)) {
dcurrent_down = current->down;
if (dcurrent_down == NULL) {
if (top_prev != NULL) {
top_prev->next = current->next;
} else {
@@ -835,13 +836,13 @@ clean_zone_node(qpznode_t *node, uint32_t least_serial) {
* current.
*/
if (top_prev != NULL) {
top_prev->next = down_next;
top_prev->next = dcurrent_down;
} else {
node->data = down_next;
node->data = dcurrent_down;
}
down_next->next = top_next;
dcurrent_down->next = top_next;
dns_slabheader_destroy(&current);
current = down_next;
current = dcurrent_down;
}
}
@@ -851,9 +852,9 @@ clean_zone_node(qpznode_t *node, uint32_t least_serial) {
*/
dparent = current;
for (dcurrent = current->down; dcurrent != NULL;
dcurrent = down_next)
dcurrent = dcurrent_down)
{
down_next = dcurrent->down;
dcurrent_down = dcurrent->down;
if (dcurrent->serial < least_serial) {
break;
}
@@ -866,10 +867,10 @@ clean_zone_node(qpznode_t *node, uint32_t least_serial) {
*/
if (dcurrent != NULL) {
do {
down_next = dcurrent->down;
dcurrent_down = dcurrent->down;
INSIST(dcurrent->serial <= least_serial);
dns_slabheader_destroy(&dcurrent);
dcurrent = down_next;
dcurrent = dcurrent_down;
} while (dcurrent != NULL);
dparent->down = NULL;
}
@@ -1980,7 +1981,7 @@ add(qpzonedb_t *qpdb, qpznode_t *node, const dns_name_t *nodename,
}
newheader->next = topheader->next;
newheader->down = topheader;
topheader->next = newheader;
topheader->up = newheader;
node->dirty = true;
if (changed != NULL) {
changed->dirty = true;
@@ -2023,7 +2024,7 @@ add(qpzonedb_t *qpdb, qpznode_t *node, const dns_name_t *nodename,
}
newheader->next = topheader->next;
newheader->down = topheader;
topheader->next = newheader;
topheader->up = newheader;
if (changed != NULL) {
changed->dirty = true;
}
@@ -4109,9 +4110,8 @@ rdatasetiter_next(dns_rdatasetiter_t *iterator DNS__DB_FLARG) {
qpzonedb_t *qpdb = (qpzonedb_t *)(qrditer->common.db);
qpznode_t *node = (qpznode_t *)qrditer->common.node;
qpz_version_t *version = (qpz_version_t *)qrditer->common.version;
dns_slabheader_t *header = NULL, *top_next = NULL;
dns_typepair_t type, negtype;
dns_rdatatype_t rdtype;
dns_slabheader_t *header = NULL;
dns_slabheader_t *topheader, *topheader_next = NULL;
isc_rwlocktype_t nlocktype = isc_rwlocktype_none;
isc_rwlock_t *nlock = &qpdb->buckets[node->locknum].lock;
@@ -4122,22 +4122,14 @@ rdatasetiter_next(dns_rdatasetiter_t *iterator DNS__DB_FLARG) {
NODE_RDLOCK(nlock, &nlocktype);
type = header->type;
rdtype = DNS_TYPEPAIR_TYPE(header->type);
negtype = DNS_TYPEPAIR_VALUE(0, rdtype);
/*
* Find the start of the header chain for the next type
* by walking back up the list.
* Find the start of the header chain for the next type.
*/
top_next = header->next;
while (top_next != NULL &&
(top_next->type == type || top_next->type == negtype))
{
top_next = top_next->next;
}
for (header = top_next; header != NULL; header = top_next) {
top_next = header->next;
topheader = dns_slabheader_top(header);
topheader_next = topheader->next;
for (header = topheader_next; header != NULL; header = topheader_next) {
topheader_next = header->next;
do {
if (header->serial <= version->serial &&
!IGNORE(header))
@@ -4153,15 +4145,12 @@ rdatasetiter_next(dns_rdatasetiter_t *iterator DNS__DB_FLARG) {
if (header != NULL) {
break;
}
/*
* Find the start of the header chain for the next type
* by walking back up the list.
* Find the start of the header chain for the next type.
*/
while (top_next != NULL &&
(top_next->type == type || top_next->type == negtype))
{
top_next = top_next->next;
}
topheader = topheader->next;
header = topheader;
}
NODE_UNLOCK(nlock, &nlocktype);

View File

@@ -39,6 +39,9 @@
#define NONEXISTENT(header) \
((atomic_load_acquire(&(header)->attributes) & \
DNS_SLABHEADERATTR_NONEXISTENT) != 0)
#define NEGATIVE(header) \
((atomic_load_acquire(&(header)->attributes) & \
DNS_SLABHEADERATTR_NEGATIVE) != 0)
/*
* The rdataslab structure allows iteration to occur in both load order
@@ -1188,3 +1191,30 @@ rdataset_getownercase(const dns_rdataset_t *rdataset, dns_name_t *name) {
unlock:
dns_db_unlocknode(header->db, header->node, isc_rwlocktype_read);
}
dns_slabheader_t *
dns_slabheader_top(dns_slabheader_t *header) {
dns_typepair_t type, negtype;
dns_rdatatype_t rdtype, covers;
type = header->type;
rdtype = DNS_TYPEPAIR_TYPE(header->type);
if (NEGATIVE(header)) {
covers = DNS_TYPEPAIR_COVERS(header->type);
negtype = DNS_TYPEPAIR_VALUE(covers, 0);
} else {
negtype = DNS_TYPEPAIR_VALUE(0, rdtype);
}
/*
* Find the start of the header chain for the next type
* by walking back up the list.
*/
while (header->up != NULL &&
(header->up->type == type || header->up->type == negtype))
{
header = header->up;
}
return header;
}

View File

@@ -19,18 +19,21 @@ with open(".gitlab-ci.yml", encoding="utf-8") as gitlab_ci_yml:
anchors = yaml.load(gitlab_ci_yml, Loader=yaml.Loader)
for tsan_job in "gcc:tsan", "clang:tsan":
tsan_stress_test_job = anchors[f"system:{tsan_job}"]
tsan_stress_test_job["stage"] = "test"
tsan_stress_test_job["rules"] = [{"if": '$CI_PIPELINE_SOURCE == "parent_pipeline"'}]
tsan_stress_test_job["parallel"] = NUMBER_OF_TESTS_PER_TSAN_JOB
tsan_stress_test_job["needs"] = [
{"pipeline": "$PARENT_PIPELINE_ID", "job": tsan_job}
]
del tsan_stress_test_job["only"]
for test_type in "unit", "system":
tsan_stress_test_job = anchors[f"{test_type}:{tsan_job}"]
tsan_stress_test_job["stage"] = "test"
tsan_stress_test_job["rules"] = [
{"if": '$CI_PIPELINE_SOURCE == "parent_pipeline"'}
]
tsan_stress_test_job["parallel"] = NUMBER_OF_TESTS_PER_TSAN_JOB
tsan_stress_test_job["needs"] = [
{"pipeline": "$PARENT_PIPELINE_ID", "job": tsan_job}
]
del tsan_stress_test_job["only"]
print(
yaml.dump(
{f"system:{tsan_job}:stress": tsan_stress_test_job},
Dumper=yaml.Dumper,
print(
yaml.dump(
{f"{test_type}:{tsan_job}:stress": tsan_stress_test_job},
Dumper=yaml.Dumper,
)
)
)