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-lightning-stream``
+^^^^^^^^^^^^^^^^^^^^^^^^^
+
+ .. versionadded:: 4.8.0
+
+Run in Lightning Stream compatible mode. This:
+
+* forces ``flag-deleted`` on
+* forces ``random-ids`` on
+* handles duplicate entries in databases that can result from domains being added on two Lightning Stream nodes at the same time
+
LMDB Structure
--------------
bool LSisDeleted(std::string_view val);
extern bool s_flag_deleted;
+ extern bool s_handle_dups;
}
#undef _LMDB_SAFE_BSWAP64MAYBE
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#include "ext/lmdb-safe/lmdb-safe.hh"
#include <lmdb.h>
#include <utility>
#ifdef HAVE_CONFIG_H
}
LMDBLS::s_flag_deleted = mustDo("flag-deleted");
+ LMDBLS::s_handle_dups = false;
+
+ if (mustDo("lightning-stream")) {
+ d_random_ids = true;
+ LMDBLS::s_flag_deleted = true;
+ LMDBLS::s_handle_dups = true;
+ }
bool opened = false;
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, "lightning-stream", "Run in Lightning Stream compatible mode", "no");
}
DNSBackend* make(const string& suffix = "") override
{