diff --git a/conduwuit-example.toml b/conduwuit-example.toml index fa5a9d42..1f7398d2 100644 --- a/conduwuit-example.toml +++ b/conduwuit-example.toml @@ -1056,10 +1056,6 @@ # #rocksdb_repair = false -# This item is undocumented. Please contribute documentation for it. -# -#rocksdb_secondary = false - # Enables idle CPU priority for compaction thread. This is not enabled by # default to prevent compaction from falling too far behind on busy # systems. @@ -1193,8 +1189,8 @@ # Allow outgoing typing updates to federation. # # Note that sending typing indicators to remote servers in large rooms -# with lots of other homeservers may cause additional strain on the CPU and -# network. +# with lots of other homeservers may cause additional strain on the CPU +# and network. # #allow_outgoing_typing = true diff --git a/src/core/config/mod.rs b/src/core/config/mod.rs index b3b89b2c..0ad6fbb6 100644 --- a/src/core/config/mod.rs +++ b/src/core/config/mod.rs @@ -1244,9 +1244,6 @@ pub struct Config { #[serde(default)] pub rocksdb_repair: bool, - #[serde(default)] - pub rocksdb_secondary: bool, - /// Enables idle CPU priority for compaction thread. This is not enabled by /// default to prevent compaction from falling too far behind on busy /// systems. diff --git a/src/database/engine.rs b/src/database/engine.rs index a178f765..45973d08 100644 --- a/src/database/engine.rs +++ b/src/database/engine.rs @@ -33,7 +33,6 @@ pub struct Engine { pub(crate) db: Db, pub(crate) pool: Arc, pub(crate) ctx: Arc, - pub(super) secondary: bool, pub(crate) checksums: bool, corks: AtomicU32, } @@ -128,14 +127,6 @@ impl Engine { sequence } - - #[inline] - #[must_use] - pub fn is_read_only(&self) -> bool { self.secondary } - - #[inline] - #[must_use] - pub fn is_secondary(&self) -> bool { self.secondary } } impl Drop for Engine { diff --git a/src/database/engine/backup.rs b/src/database/engine/backup.rs index 03413bd4..69d510f3 100644 --- a/src/database/engine/backup.rs +++ b/src/database/engine/backup.rs @@ -12,9 +12,8 @@ pub fn backup(&self) -> Result { let mut engine = self.backup_engine()?; let config = &self.ctx.server.config; if config.database_backups_to_keep > 0 { - let flush = !self.is_read_only(); engine - .create_new_backup_flush(&self.db, flush) + .create_new_backup_flush(&self.db, true) .map_err(map_err)?; let engine_info = engine.get_backup_info(); diff --git a/src/database/engine/open.rs b/src/database/engine/open.rs index c7fb5013..bd95bea0 100644 --- a/src/database/engine/open.rs +++ b/src/database/engine/open.rs @@ -35,11 +35,7 @@ pub(crate) async fn open(ctx: Arc, desc: &[Descriptor]) -> Result, desc: &[Descriptor]) -> Result impl Iterator + Send + '_ { self.maps.keys() } - - #[inline] - #[must_use] - pub fn is_read_only(&self) -> bool { self.db.is_read_only() } - - #[inline] - #[must_use] - pub fn is_secondary(&self) -> bool { self.db.is_secondary() } } impl Index<&str> for Database { diff --git a/src/service/emergency/mod.rs b/src/service/emergency/mod.rs index f8ecbb3e..9dc6fbe4 100644 --- a/src/service/emergency/mod.rs +++ b/src/service/emergency/mod.rs @@ -37,10 +37,6 @@ impl crate::Service for Service { } async fn worker(self: Arc) -> Result { - if self.services.globals.is_read_only() { - return Ok(()); - } - if self.services.config.ldap.enable { warn!("emergency password feature not available with LDAP enabled."); return Ok(()); diff --git a/src/service/globals/mod.rs b/src/service/globals/mod.rs index 1fb6d2cf..938bfcc5 100644 --- a/src/service/globals/mod.rs +++ b/src/service/globals/mod.rs @@ -156,7 +156,4 @@ impl Service { pub fn server_is_ours(&self, server_name: &ServerName) -> bool { server_name == self.server_name() } - - #[inline] - pub fn is_read_only(&self) -> bool { self.db.db.is_read_only() } } diff --git a/src/service/services.rs b/src/service/services.rs index f976a5b1..30f5ac19 100644 --- a/src/service/services.rs +++ b/src/service/services.rs @@ -139,7 +139,7 @@ impl Services { // reset dormant online/away statuses to offline, and set the server user as // online - if self.server.config.allow_local_presence && !self.db.is_read_only() { + if self.server.config.allow_local_presence { self.presence.unset_all_presence().await; _ = self .presence @@ -156,7 +156,7 @@ impl Services { info!("Shutting down services..."); // set the server user as offline - if self.server.config.allow_local_presence && !self.db.is_read_only() { + if self.server.config.allow_local_presence { _ = self .presence .ping_presence(&self.globals.server_user, &ruma::presence::PresenceState::Offline)