diff --git a/Cargo.lock b/Cargo.lock index 64516b0b..5011cee4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2953,7 +2953,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite 0.2.13", - "socket2 0.5.5", + "socket2 0.4.10", "tokio", "tower-service", "tracing", diff --git a/common/db/src/rocks.rs b/common/db/src/rocks.rs index 046bbfd3..c48f6c49 100644 --- a/common/db/src/rocks.rs +++ b/common/db/src/rocks.rs @@ -1,7 +1,8 @@ use std::sync::Arc; use rocksdb::{ - DBCompressionType, ThreadMode, SingleThreaded, LogLevel, Options, Transaction, TransactionDB, + DBCompressionType, ThreadMode, SingleThreaded, LogLevel, WriteOptions, Transaction, Options, + TransactionDB, }; use crate::*; @@ -31,7 +32,9 @@ impl Get for Arc> { impl Db for Arc> { type Transaction<'a> = Transaction<'a, TransactionDB>; fn txn(&mut self) -> Self::Transaction<'_> { - self.transaction() + let mut opts = WriteOptions::default(); + opts.set_sync(true); + self.transaction_opt(&opts, &Default::default()) } }