diff options
author | Alex Auvolat <alex@adnab.me> | 2023-05-17 14:30:53 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2023-05-17 14:30:53 +0200 |
commit | 19639705e6242861bd43a123456793e2d8f2c69a (patch) | |
tree | 17710b95f770cdde8e6405479f8262a12bcf6a13 /src/model | |
parent | 351d734e6c035a6f22f9fe0d62a783a81a134f45 (diff) | |
download | garage-19639705e6242861bd43a123456793e2d8f2c69a.tar.gz garage-19639705e6242861bd43a123456793e2d8f2c69a.zip |
Mark sled as deprecated, make lmdb default, and improve sqlite and lmdb defaults
Diffstat (limited to 'src/model')
-rw-r--r-- | src/model/Cargo.toml | 2 | ||||
-rw-r--r-- | src/model/garage.rs | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/model/Cargo.toml b/src/model/Cargo.toml index 6dc954d4..c4291c32 100644 --- a/src/model/Cargo.toml +++ b/src/model/Cargo.toml @@ -41,7 +41,7 @@ opentelemetry = "0.17" netapp = "0.5" [features] -default = [ "sled" ] +default = [ "sled", "lmdb", "sqlite" ] k2v = [ "garage_util/k2v" ] lmdb = [ "garage_db/lmdb" ] sled = [ "garage_db/sled" ] diff --git a/src/model/garage.rs b/src/model/garage.rs index 3daa1b33..0fbcf334 100644 --- a/src/model/garage.rs +++ b/src/model/garage.rs @@ -109,6 +109,11 @@ impl Garage { db_path.push("db.sqlite"); info!("Opening Sqlite database at: {}", db_path.display()); let db = db::sqlite_adapter::rusqlite::Connection::open(db_path) + .and_then(|db| { + db.pragma_update(None, "journal_mode", &"WAL")?; + db.pragma_update(None, "synchronous", &"NORMAL")?; + Ok(db) + }) .ok_or_message("Unable to open sqlite DB")?; db::sqlite_adapter::SqliteDb::init(db) } @@ -133,7 +138,6 @@ impl Garage { env_builder.max_readers(500); env_builder.map_size(map_size); unsafe { - env_builder.flag(heed::flags::Flags::MdbNoSync); env_builder.flag(heed::flags::Flags::MdbNoMetaSync); } let db = match env_builder.open(&db_path) { |