From 35c8ce2ccbc1497e050f0f089eb8e6d8b3f129fd Mon Sep 17 00:00:00 2001 From: "Dustin J. Mitchell" Date: Sat, 23 Apr 2022 18:30:48 +0000 Subject: [PATCH] Remove references to TDB2::read_only A TC replica is always read-write. --- src/Context.cpp | 10 +--------- src/TDB2.cpp | 10 ---------- src/TDB2.h | 3 --- 3 files changed, 1 insertion(+), 22 deletions(-) diff --git a/src/Context.cpp b/src/Context.cpp index e74091914..313bdc20d 100644 --- a/src/Context.cpp +++ b/src/Context.cpp @@ -851,8 +851,7 @@ int Context::dispatch (std::string &out) assert (c); // The command know whether they need a GC. - if (c->needs_gc () && - ! tdb2.read_only ()) + if (c->needs_gc ()) { run_gc = config.getBoolean ("gc"); tdb2.gc (); @@ -862,13 +861,6 @@ int Context::dispatch (std::string &out) run_gc = false; } -/* - // Only read-only commands can be run when TDB2 is read-only. - // TODO Implement TDB2::read_only - if (tdb2.read_only () && !c->read_only ()) - throw std::string (""); -*/ - // This is something that is only needed for write commands with no other // filter processing. if (c->accepts_modifications () && diff --git a/src/TDB2.cpp b/src/TDB2.cpp index 8bd3c2f9c..89c146bfe 100644 --- a/src/TDB2.cpp +++ b/src/TDB2.cpp @@ -1261,16 +1261,6 @@ bool TDB2::verifyUniqueUUID (const std::string& uuid) return pending.id (uuid) != 0 ? false : true; } -//////////////////////////////////////////////////////////////////////////////// -bool TDB2::read_only () -{ - return pending._read_only || - completed._read_only || - undo._read_only || - backlog._read_only - ; -} - //////////////////////////////////////////////////////////////////////////////// int TDB2::num_local_changes () { diff --git a/src/TDB2.h b/src/TDB2.h index 52455c575..f7719fb32 100644 --- a/src/TDB2.h +++ b/src/TDB2.h @@ -134,9 +134,6 @@ public: std::string uuid (int); int id (const std::string&); - // Read-only mode. - bool read_only (); - int num_local_changes (); int num_reverts_possible ();