From bee829f4a0ae40f7ff755893b6ee5bf7d6ea3794 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Wed, 15 Jun 2022 20:44:24 -0700 Subject: [PATCH] ircd::m: Disable the WAL for bootstrap eval txns. --- matrix/homeserver_bootstrap.cc | 9 ++++++--- matrix/vm_execute.cc | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/matrix/homeserver_bootstrap.cc b/matrix/homeserver_bootstrap.cc index f46779e71..4f45aad5e 100644 --- a/matrix/homeserver_bootstrap.cc +++ b/matrix/homeserver_bootstrap.cc @@ -247,6 +247,9 @@ try //XXX Consider enable for large batch size. //vmopts.phase.set(vm::phase::PREINDEX, true); + // Optimize the bootstrap by disabling WAL journaling. + vmopts.wopts.sopts |= db::set::NO_JOURNAL; + // Optimize the bootstrap by not updating room heads at every step. vmopts.wopts.appendix.set(dbs::appendix::ROOM_HEAD, false); vmopts.wopts.appendix.set(dbs::appendix::ROOM_HEAD_RESOLVE, false); @@ -377,9 +380,9 @@ try } // Manual flush of the memtables is required in case the user disabled the - // WAL (which is advised in the documentation). If this isn't run several - // thousand keys in memory will be dropped inconsistently between database - // columns. If WAL is enabled then it tidies the DB up just as well. + // WAL. If this isn't run several thousand keys in memory will be dropped + // inconsistently between database columns. If WAL is enabled then it + // tidies the DB up just as well. if(likely(sequence(*dbs::events) > 0)) { const bool blocking(true), allow_stall(true); diff --git a/matrix/vm_execute.cc b/matrix/vm_execute.cc index dbf2f9215..4bde92767 100644 --- a/matrix/vm_execute.cc +++ b/matrix/vm_execute.cc @@ -1194,7 +1194,7 @@ ircd::m::vm::write_commit(eval &eval) write_commit_cycles }; - txn(wopts.sopts); + txn(sopts); } ++write_commit_count;