0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-25 23:14:13 +01:00

ircd::db: Add conf item to toggle WAL in write opts.

This commit is contained in:
Jason Volk 2020-09-15 01:53:30 -07:00
parent 3cf21998ae
commit a2df9a9cdc
2 changed files with 10 additions and 1 deletions

View file

@ -8965,12 +8965,20 @@ ircd::db::make_opts(const sopts &opts)
return ret;
}
decltype(ircd::db::enable_wal)
ircd::db::enable_wal
{
{ "name", "ircd.db.wal.enable" },
{ "default", true },
{ "persist", false },
};
rocksdb::WriteOptions &
ircd::db::operator+=(rocksdb::WriteOptions &ret,
const sopts &opts)
{
ret.sync = test(opts, set::FSYNC);
ret.disableWAL = test(opts, set::NO_JOURNAL);
ret.disableWAL = !enable_wal || test(opts, set::NO_JOURNAL);
ret.ignore_missing_column_families = test(opts, set::NO_COLUMN_ERR);
ret.no_slowdown = test(opts, set::NO_BLOCKING);
ret.low_pri = test(opts, set::PRIO_LOW);

View file

@ -65,6 +65,7 @@ namespace ircd::db
// state
extern log::log rog;
extern conf::item<bool> enable_wal;
extern conf::item<size_t> request_pool_size;
extern conf::item<size_t> request_pool_stack_size;
extern ctx::pool::opts request_pool_opts;