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;
}
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();
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
- 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
*/