aboutsummaryrefslogtreecommitdiff
path: root/src/db.cpp
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@exmulti.com>2012-05-19 01:25:06 -0400
committerJeff Garzik <jgarzik@redhat.com>2012-05-19 01:25:06 -0400
commit394b9298faec503f3780645ed17fa00cce6da2dd (patch)
treec1b5cbe180e3cafa2ab4658c33001bc2292f50f1 /src/db.cpp
parentd6615a54c6146728717ad0f8819f32f002613f5c (diff)
Default to DB_TXN_WRITE_NOSYNC for all transactional operations
* This is safer than DB_TXN_NOSYNC, and does not appear to impact performance. * Applying this to the dbenv is necessary to avoid many fdatasync(2) calls on db 5.x * We carefully and thoroughly flush databases upon shutdown and other important events already.
Diffstat (limited to 'src/db.cpp')
-rw-r--r--src/db.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/db.cpp b/src/db.cpp
index cbcbd3faa0..50f0891626 100644
--- a/src/db.cpp
+++ b/src/db.cpp
@@ -96,6 +96,7 @@ CDB::CDB(const char *pszFile, const char* pszMode) : pdb(NULL)
dbenv.set_lk_max_locks(10000);
dbenv.set_lk_max_objects(10000);
dbenv.set_errfile(fopen(pathErrorFile.string().c_str(), "a")); /// debug
+ dbenv.set_flags(DB_TXN_WRITE_NOSYNC, 1);
dbenv.set_flags(DB_AUTO_COMMIT, 1);
dbenv.log_set_config(DB_LOG_AUTO_REMOVE, 1);
ret = dbenv.open(pathDataDir.string().c_str(),