From 23d77b614f2ea6e5704845bd89df0374873644bd Mon Sep 17 00:00:00 2001 From: Terry Date: Wed, 18 Feb 2026 22:39:02 +0000 Subject: [PATCH] fix: Remove ability to set rocksdb as read only --- conduwuit-example.toml | 4 ---- src/core/config/mod.rs | 3 --- src/database/engine.rs | 3 +-- src/database/engine/open.rs | 5 +---- src/main/clap.rs | 10 +--------- 5 files changed, 3 insertions(+), 22 deletions(-) diff --git a/conduwuit-example.toml b/conduwuit-example.toml index f770de1f..fa5a9d42 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_read_only = false - # This item is undocumented. Please contribute documentation for it. # #rocksdb_secondary = false diff --git a/src/core/config/mod.rs b/src/core/config/mod.rs index 004f7790..b3b89b2c 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_read_only: bool, - #[serde(default)] pub rocksdb_secondary: bool, diff --git a/src/database/engine.rs b/src/database/engine.rs index 38dd7512..a178f765 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) read_only: bool, pub(super) secondary: bool, pub(crate) checksums: bool, corks: AtomicU32, @@ -132,7 +131,7 @@ impl Engine { #[inline] #[must_use] - pub fn is_read_only(&self) -> bool { self.secondary || self.read_only } + pub fn is_read_only(&self) -> bool { self.secondary } #[inline] #[must_use] diff --git a/src/database/engine/open.rs b/src/database/engine/open.rs index 6fc1a281..c7fb5013 100644 --- a/src/database/engine/open.rs +++ b/src/database/engine/open.rs @@ -35,9 +35,7 @@ pub(crate) async fn open(ctx: Arc, desc: &[Descriptor]) -> Result, desc: &[Descriptor]) -> Result, - /// Run in a stricter read-only --maintenance mode. - #[arg(long)] - pub read_only: bool, - /// Run in maintenance mode while refusing connections. #[arg(long)] pub maintenance: bool, @@ -143,11 +139,7 @@ pub(crate) fn parse() -> Args { Args::parse() } /// Synthesize any command line options with configuration file options. pub(crate) fn update(mut config: Figment, args: &Args) -> Result { - if args.read_only { - config = config.join(("rocksdb_read_only", true)); - } - - if args.maintenance || args.read_only { + if args.maintenance { config = config.join(("startup_netburst", false)); config = config.join(("listening", false)); }