Radish alpha
h
rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5
Radicle Heartwood Protocol & Stack
Radicle
Git
radicle/config/sqlite: Use `synchronous = NORMAL`
Lorenz Leutgeb committed 1 month ago
commit f3afe7b02ae55f8a9cd28c50335453b5b2b4d59f
parent f4aee20
2 files changed +7 -2
modified crates/radicle/CHANGELOG.md
@@ -15,6 +15,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

+
- The default configuration for the SQLite pragma `synchronous` is changed
+
  from `FULL` to `NORMAL`, which generates less I/O operations. On power
+
  loss, transactions might be rolled back, but SQLite still guarantees
+
  consistency in this mode.
+

### Removed

### Security
modified crates/radicle/src/node/db/config.rs
@@ -1,7 +1,7 @@
use super::sqlite_ext::*;

const DEFAULT_JOURNAL_MODE: JournalMode = JournalMode::WAL;
-
const DEFAULT_SYNCHRONOUS: Synchronous = Synchronous::FULL;
+
const DEFAULT_SYNCHRONOUS: Synchronous = Synchronous::NORMAL;

/// Database configuration.
#[derive(Debug, Default, Copy, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
@@ -88,7 +88,7 @@ mod test {
    #[test]
    fn database_config_valid_combinations() {
        let cases = [
-
            (None, None, JournalMode::WAL, Synchronous::FULL),
+
            (None, None, JournalMode::WAL, Synchronous::NORMAL),
            (
                Some("WAL"),
                Some("NORMAL"),