- Default: yes
Always update the domains table in the database when the last notification
-timestamp is modified.
+or the freshness check timestamp are modified.
If disabled, these timestamps will only be written back to the database when
other changes to the domain (such as accounts) occur.
This setting is also available in version 4.9.9.
**Warning**: Running with this flag disabled will cause spurious notifications
-to be sent upon startup, unless a ``flush'' command is sent using
+to be sent upon startup, unless a ``flush`` command is sent using
:doc:`pdns_control <../manpages/pdns_control.1>` before stopping the
PowerDNS Authoritative Server.
TransientDomainInfo tdi;
container->get(info.id, tdi);
info.notified_serial = tdi.notified_serial;
+ info.last_check = tdi.last_check;
}
}
container->get(info.id, tdi);
// Only remove the in-memory value if it has not been modified since the
// DomainInfo data was set up.
- if (tdi.notified_serial == info.notified_serial) {
+ if (tdi.notified_serial == info.notified_serial && tdi.last_check == info.last_check) {
container->remove(info.id);
}
}
void LMDBBackend::setStale(domainid_t domain_id)
{
- genChangeDomain(domain_id, [](DomainInfo& di) {
- di.last_check = 0;
- });
+ setLastCheckTime(domain_id, 0);
}
void LMDBBackend::setFresh(domainid_t domain_id)
{
- genChangeDomain(domain_id, [](DomainInfo& di) {
- di.last_check = time(nullptr);
- });
+ setLastCheckTime(domain_id, time(nullptr));
+}
+
+void LMDBBackend::setLastCheckTime(domainid_t domain_id, time_t last_check)
+{
+ if (d_write_notification_update) {
+ genChangeDomain(domain_id, [last_check](DomainInfo& info) {
+ info.last_check = last_check;
+ });
+ return;
+ }
+
+ DomainInfo info;
+ if (findDomain(domain_id, info)) {
+ auto container = s_transient_domain_info.write_lock();
+ TransientDomainInfo tdi;
+ container->get(info.id, tdi);
+ tdi.last_check = last_check;
+ container->update(info.id, tdi);
+ }
}
void LMDBBackend::getUpdatedPrimaries(vector<DomainInfo>& updatedDomains, std::unordered_set<DNSName>& catalogs, CatalogHashMap& catalogHashes)
if (findDomain(domain_id, info)) {
auto container = s_transient_domain_info.write_lock();
TransientDomainInfo tdi;
- // will need container->get(info.id, tdi); once TransientDomainInfo grows
- // more fields.
+ container->get(info.id, tdi);
tdi.notified_serial = serial;
container->update(info.id, tdi);
}
DomainInfo info;
if (findDomain(domid, info)) {
info.notified_serial = tdi.notified_serial;
+ info.last_check = tdi.last_check;
auto txn = d_tdomains->getRWTransaction();
txn.put(info, info.id);
txn.commit();
void consolidateDomainInfo(DomainInfo& info) const;
void writeDomainInfo(const DomainInfo& info);
+ void setLastCheckTime(domainid_t domain_id, time_t last_check);
+
void getAllDomainsFiltered(vector<DomainInfo>* domains, const std::function<bool(DomainInfo&)>& allow);
void lookupStart(domainid_t domain_id, const std::string& match, bool dolog);
// database.
struct TransientDomainInfo
{
+ time_t last_check{};
uint32_t notified_serial{};
};
// Cache of DomainInfo notified_serial values