Instead of deleting items from the database, flag them as deleted in the item's `Lightning Stream <https://doc.powerdns.com/lightningstream>`_ header.
Only enable this if you are using Lightning Stream.
-``lmdb-skip-notification-update``
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+``lmdb-write-notification-update``
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- .. versionadded:: 5.1.0
+ .. versionadded:: 5.0.1
- Boolean
-- Default: no
+- Default: yes
-Do not update the domains table in the database when the last notification
-timestamp is modified. These timestamps will only be written back to the
-database when other changes to the domain (such as accounts) occur.
+Always update the domains table in the database when the last notification
+timestamp is modified.
+If disabled, these timestamps will only be written back to the database when
+other changes to the domain (such as accounts) occur.
-**Warning**: Running with this flag enabled will cause spurious notifications
+**Warning**: Running with this flag disabled will cause spurious notifications
to be sent upon startup.
``lmdb-lightning-stream``
throw std::runtime_error(std::string("Unable to parse the 'map-size' LMDB value: ") + e.what());
}
- d_skip_notification_update = mustDo("skip-notification-update");
+ d_write_notification_update = mustDo("write-notification-update");
if (mustDo("lightning-stream")) {
d_random_ids = true;
void LMDBBackend::consolidateDomainInfo(DomainInfo& info) const
{
// Update the notified_serial value if we have a cached value in memory.
- if (d_skip_notification_update) {
+ if (!d_write_notification_update) {
auto container = s_notified_serial.read_lock();
container->get(info.id, info.notified_serial);
}
void LMDBBackend::writeDomainInfo(const DomainInfo& info)
{
- if (d_skip_notification_update) {
+ if (!d_write_notification_update) {
uint32_t last_notified_serial{0};
auto container = s_notified_serial.write_lock();
container->get(info.id, last_notified_serial);
void LMDBBackend::setNotified(domainid_t domain_id, uint32_t serial)
{
- if (!d_skip_notification_update) {
+ if (d_write_notification_update) {
genChangeDomain(domain_id, [serial](DomainInfo& info) {
info.notified_serial = serial;
});
auto container = s_notified_serial.write_lock();
container->update(info.id, serial);
}
- // else throw something? this should be a "can't happen" situation.
}
class getCatalogMembersReturnFalseException : std::runtime_error
declare(suffix, "random-ids", "Numeric IDs inside the database are generated randomly instead of sequentially", "no");
declare(suffix, "map-size", "LMDB map size in megabytes", (sizeof(void*) == 4) ? "100" : "16000");
declare(suffix, "flag-deleted", "Flag entries on deletion instead of deleting them", "no");
- declare(suffix, "skip-notification-update", "Do not update domain table upon notification", "no");
+ declare(suffix, "write-notification-update", "Do not update domain table upon notification", "yes");
declare(suffix, "lightning-stream", "Run in Lightning Stream compatible mode", "no");
}
DNSBackend* make(const string& suffix = "") override