Re-acquire the node when reusing it while deleting dead nodes

When the node gets reused in the closeversion cleaning of the dead nodes
because the write transaction hasn't been opened yet, it would lead to
double call to qpznode_release() on the same node.  This is ultimately
leads to assertion failure because the reference counting on the erefs
would go negative, but the cleaning code is not working as expected thus
it went unnoticed.
This commit is contained in:
Ondřej Surý
2025-03-05 17:20:53 -08:00
committed by Evan Hunt
parent e3b79acf42
commit 503a172ac9
+4
View File
@@ -1597,6 +1597,10 @@ closeversion(dns_db_t *db, dns_dbversion_t **versionp,
}
}
if (next_changed == changed) {
qpznode_acquire(qpdb, node DNS__DB_FLARG_PASS);
}
qpznode_detach(&node);
NODE_UNLOCK(nlock, &nlocktype);