aboutsummaryrefslogtreecommitdiff
path: root/src/garage/cli/convert_db.rs
diff options
context:
space:
mode:
authorAlex <alex@adnab.me>2023-10-10 13:28:28 +0000
committerAlex <alex@adnab.me>2023-10-10 13:28:28 +0000
commite6df7089a19d06696ac2178a4dae7ac9f27fd55e (patch)
treee1f7120d582f67fd104dc8e746d883befffb4daa /src/garage/cli/convert_db.rs
parente75fe2157d0973eb4320bbc87be5e54a1cb91a63 (diff)
parent952c9570c494468643353ee1ae9052b510353665 (diff)
downloadgarage-e6df7089a19d06696ac2178a4dae7ac9f27fd55e.tar.gz
garage-e6df7089a19d06696ac2178a4dae7ac9f27fd55e.zip
Merge pull request 'Garage v0.9' (#473) from next into main
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/473
Diffstat (limited to 'src/garage/cli/convert_db.rs')
-rw-r--r--src/garage/cli/convert_db.rs14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/garage/cli/convert_db.rs b/src/garage/cli/convert_db.rs
index f590a4b6..3c6ce69c 100644
--- a/src/garage/cli/convert_db.rs
+++ b/src/garage/cli/convert_db.rs
@@ -41,6 +41,8 @@ fn open_db(path: PathBuf, engine: String) -> Result<Db> {
#[cfg(feature = "sqlite")]
"sqlite" | "sqlite3" | "rusqlite" => {
let db = sqlite_adapter::rusqlite::Connection::open(&path)?;
+ db.pragma_update(None, "journal_mode", &"WAL")?;
+ db.pragma_update(None, "synchronous", &"NORMAL")?;
Ok(sqlite_adapter::SqliteDb::init(db))
}
#[cfg(feature = "lmdb")]
@@ -51,11 +53,13 @@ fn open_db(path: PathBuf, engine: String) -> Result<Db> {
let map_size = lmdb_adapter::recommended_map_size();
- let db = lmdb_adapter::heed::EnvOpenOptions::new()
- .max_dbs(100)
- .map_size(map_size)
- .open(&path)
- .unwrap();
+ let mut env_builder = lmdb_adapter::heed::EnvOpenOptions::new();
+ env_builder.max_dbs(100);
+ env_builder.map_size(map_size);
+ unsafe {
+ env_builder.flag(lmdb_adapter::heed::flags::Flags::MdbNoMetaSync);
+ }
+ let db = env_builder.open(&path)?;
Ok(lmdb_adapter::LmdbDb::init(db))
}
e => Err(Error(