From: Miod Vallat Date: Thu, 12 Jun 2025 07:36:46 +0000 (+0200) Subject: Make comments slightly less inaccurate. X-Git-Tag: dnsdist-2.0.0-beta1~27^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f40e410367b4cbe685564c3055197050eae3ac5f;p=thirdparty%2Fpdns.git Make comments slightly less inaccurate. --- diff --git a/modules/bindbackend/bindbackend2.cc b/modules/bindbackend/bindbackend2.cc index 675a372fa9..58a9960b0d 100644 --- a/modules/bindbackend/bindbackend2.cc +++ b/modules/bindbackend/bindbackend2.cc @@ -249,6 +249,8 @@ bool Bind2Backend::startTransaction(const ZoneName& qname, domainid_t domainId) bool Bind2Backend::commitTransaction() { + // d_transaction_id is only set to a valid domain id if we are actually + // setting up a replacement zone file with the updated data. if (d_transaction_id == UnknownDomainID) { return false; } @@ -268,9 +270,8 @@ bool Bind2Backend::commitTransaction() bool Bind2Backend::abortTransaction() { - // -1 = dnssec speciality - // 0 = invalid transact - // >0 = actual transaction + // d_transaction_id is only set to a valid domain id if we are actually + // setting up a replacement zone file with the updated data. if (d_transaction_id != UnknownDomainID) { unlink(d_transaction_tmpname.c_str()); d_of.reset(); diff --git a/pdns/dnsbackend.hh b/pdns/dnsbackend.hh index 19b2efb23f..0a779c93c8 100644 --- a/pdns/dnsbackend.hh +++ b/pdns/dnsbackend.hh @@ -294,7 +294,6 @@ public: return false; } - //! returns true if primary ip is primary for domain name. //! starts the transaction for updating domain qname, destroying all //! existing data for that domain if id is != UnknownDomainID. In this case, //! the id MUST match the DomainInfo information for qname, or very bad things diff --git a/pdns/packethandler.cc b/pdns/packethandler.cc index c85cb9eeea..4c1338a870 100644 --- a/pdns/packethandler.cc +++ b/pdns/packethandler.cc @@ -1020,24 +1020,19 @@ void PacketHandler::addNSEC(DNSPacket& /* p */, std::unique_ptr& r, c - only one backend owns the SOA of a zone - only one AXFR per zone at a time - double startTransaction should fail -- backends need to implement transaction semantics +- backends implement transaction semantics - -How BindBackend would implement this: +How BindBackend implements this: startTransaction makes a file feedRecord sends everything to that file commitTransaction moves that file atomically over the regular file, and triggers a reload - rollbackTransaction removes the file - + abortTransaction removes the file -How PostgreSQLBackend would implement this: - startTransaction starts a sql transaction, which also deletes all records +How SQL backends implement this: + startTransaction starts a sql transaction, which also deletes all records if requested feedRecord is an insert statement commitTransaction commits the transaction - rollbackTransaction aborts it - -How MySQLBackend would implement this: - (good question!) + abortTransaction aborts it */