it will (silently) serve it without DNSSEC. This in turn results in
serving the domain as bogus.
+.. _setting-bind-dnssec-db-journal-mode:
+
+``bind-dnssec-db-journal-mode``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+SQLite3 journal mode to set. The default is WAL. Set to empty to leave the journal mode alone.
+
.. _setting-bind-hybrid:
``bind-hybrid``
Path to the SQLite3 database.
+.. _setting-gsqlite3-pragma-journal-mode:
+
+``gsqlite3-pragma-journal-mode``
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+SQLite3 journal mode to set. The default is WAL. Set to empty to leave the journal mode alone.
+
.. _setting-gsqlite3-pragma-synchronous:
``gsqlite3-pragma-synchronous``
--------------
- Superslave operation is no longer enabled by default, use :ref:`setting-superslave` to enable. This setting was called ``supermaster`` in some 4.2.0 prereleases.
+- The gsqlite3 backend, and the DNSSEC database for the BIND backend, have a new journal-mode setting. This setting defaults to `WAL <https://www.sqlite.org/wal.html>`_; older versions of PowerDNS did not set the journal mode, which means they used the SQLite default of DELETE.
4.1.0 to 4.1.1
--------------
declare(suffix,"supermasters","List of IP-addresses of supermasters","");
declare(suffix,"supermaster-destdir","Destination directory for newly added slave zones",::arg()["config-dir"]);
declare(suffix,"dnssec-db","Filename to store & access our DNSSEC metadatabase, empty for none", "");
+ declare(suffix,"dnssec-db-journal-mode","SQLite3 journal mode", "WAL");
declare(suffix,"hybrid","Store DNSSEC metadata in other backend","no");
}
if(getArg("dnssec-db").empty() || d_hybrid)
return;
try {
- d_dnssecdb = shared_ptr<SSQLite3>(new SSQLite3(getArg("dnssec-db")));
+ d_dnssecdb = shared_ptr<SSQLite3>(new SSQLite3(getArg("dnssec-db"), getArg("dnssec-db-journal-mode")));
setupStatements();
}
catch(SSqlException& se) {
{
try
{
- SSQLite3 *ptr = new SSQLite3( getArg( "database" ));
+ SSQLite3 *ptr = new SSQLite3( getArg( "database" ), getArg( "pragma-journal-mode") );
setDB(ptr);
if(!getArg("pragma-synchronous").empty()) {
ptr->execute("PRAGMA synchronous="+getArg("pragma-synchronous"));
declare(suffix, "database", "Filename of the SQLite3 database", "powerdns.sqlite");
declare(suffix, "pragma-synchronous", "Set this to 0 for blazing speed", "");
declare(suffix, "pragma-foreign-keys", "Enable foreign key constraints", "no" );
+ declare(suffix, "pragma-journal-mode", "SQLite3 journal mode", "WAL");
declare(suffix, "dnssec", "Enable DNSSEC processing","no");
return 0;
}
try {
- SSQLite3 db(cmds[1], true); // create=ok
+ SSQLite3 db(cmds[1], "", true); // create=ok
vector<string> statements;
stringtok(statements, sqlCreate, ";");
for(const string& statement : statements) {
};
// Constructor.
-SSQLite3::SSQLite3( const std::string & database, bool creat )
+SSQLite3::SSQLite3( const std::string & database, const std::string & journalmode, bool creat )
{
if (access( database.c_str(), F_OK ) == -1){
if (!creat)
m_dolog = 0;
m_in_transaction = false;
sqlite3_busy_handler(m_pDB, busyHandler, 0);
+
+ if(journalmode.length())
+ execute("PRAGMA journal_mode="+journalmode);
}
void SSQLite3::setLog(bool state)
protected:
public:
//! Constructor.
- SSQLite3( const std::string & database, bool creat=false );
+ SSQLite3( const std::string & database, const std::string & journalmode, bool creat=false);
//! Destructor.
~SSQLite3();