]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Reverse polarity 16147/head
authorMiod Vallat <miod.vallat@powerdns.com>
Fri, 19 Sep 2025 12:42:21 +0000 (14:42 +0200)
committerMiod Vallat <miod.vallat@powerdns.com>
Fri, 19 Sep 2025 14:46:43 +0000 (16:46 +0200)
Signed-off-by: Miod Vallat <miod.vallat@powerdns.com>
(cherry picked from commit 86d641da024d9a153f8fdc710d38e1bc18f1b7de)

docs/backends/lmdb.rst
modules/lmdbbackend/lmdbbackend.cc
modules/lmdbbackend/lmdbbackend.hh

index 0f12e2b7c9ecb734ef5fa84214b7cb1ef341bc4a..c14d1601d3b99e85af8971d3b204bef05bdd1805 100644 (file)
@@ -133,19 +133,20 @@ Defaults to 100 on 32 bit systems, and 16000 on 64 bit systems.
 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``
index 376aa14143a0638f4156d13e58c5186e3a602e84..041da07218c5c840506ea7fcbfb45889cbb1fe87 100644 (file)
@@ -722,7 +722,7 @@ LMDBBackend::LMDBBackend(const std::string& suffix)
     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;
@@ -1170,7 +1170,7 @@ bool LMDBBackend::findDomain(domainid_t domainid, DomainInfo& info) const
 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);
   }
@@ -1178,7 +1178,7 @@ void LMDBBackend::consolidateDomainInfo(DomainInfo& info) const
 
 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);
@@ -2296,7 +2296,7 @@ void LMDBBackend::getUpdatedPrimaries(vector<DomainInfo>& updatedDomains, std::u
 
 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;
     });
@@ -2308,7 +2308,6 @@ void LMDBBackend::setNotified(domainid_t domain_id, uint32_t 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
@@ -3248,7 +3247,7 @@ public:
     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
index 01addb7cbfbc0c8460037f64baa55981d4fa5f13..b4a8f1834e08d556d46d781c57fec96fb4e68af8 100644 (file)
@@ -384,7 +384,7 @@ private:
   bool d_random_ids;
   bool d_handle_dups;
   bool d_views;
-  bool d_skip_notification_update;
+  bool d_write_notification_update;
   DTime d_dtime; // used only for logging
   uint64_t d_mapsize;
 };