diff --git a/doc/rippled-example.cfg b/doc/rippled-example.cfg index 1160554348..f91d8e4a41 100644 --- a/doc/rippled-example.cfg +++ b/doc/rippled-example.cfg @@ -661,7 +661,6 @@ # migrate the specified database into the current database given # in the [node_db] section. # -# [temp_db] Settings for the look-aside temporary db (optional) # [import_db] Settings for performing a one-time import (optional) # [database_path] Path to the book-keeping databases. # @@ -671,7 +670,6 @@ # rippled.cfg file. Partial pathnames will be considered relative to # the location of the rippled executable. # -# The [temp_db] configuration setting is deprecated and should be avoided. # # # diff --git a/src/ripple/app/main/Main.cpp b/src/ripple/app/main/Main.cpp index 136f01b83e..ed2e1bb809 100644 --- a/src/ripple/app/main/Main.cpp +++ b/src/ripple/app/main/Main.cpp @@ -168,7 +168,6 @@ setupConfigForUnitTests (Config& config) config.overwrite (ConfigSection::nodeDatabase (), "type", "memory"); config.overwrite (ConfigSection::nodeDatabase (), "path", "main"); - config.deprecatedClearSection (ConfigSection::tempNodeDatabase ()); config.deprecatedClearSection (ConfigSection::importNodeDatabase ()); config.legacy("database_path", "DummyForUnitTests"); } diff --git a/src/ripple/app/misc/SHAMapStore.h b/src/ripple/app/misc/SHAMapStore.h index a07ec0d3e7..364077836c 100644 --- a/src/ripple/app/misc/SHAMapStore.h +++ b/src/ripple/app/misc/SHAMapStore.h @@ -44,7 +44,6 @@ public: bool advisoryDelete = false; std::uint32_t ledgerHistory = 0; Section nodeDatabase; - Section ephemeralNodeDatabase; std::string databasePath; std::uint32_t deleteBatch = 100; std::uint32_t backOff = 100; diff --git a/src/ripple/app/misc/SHAMapStoreImp.cpp b/src/ripple/app/misc/SHAMapStoreImp.cpp index 4ed922e286..00065de7e0 100644 --- a/src/ripple/app/misc/SHAMapStoreImp.cpp +++ b/src/ripple/app/misc/SHAMapStoreImp.cpp @@ -227,8 +227,7 @@ SHAMapStoreImp::makeDatabase (std::string const& name, else { db = NodeStore::Manager::instance().make_Database (name, scheduler_, nodeStoreJournal_, - readThreads, setup_.nodeDatabase, - setup_.ephemeralNodeDatabase); + readThreads, setup_.nodeDatabase); } return db; @@ -492,14 +491,8 @@ SHAMapStoreImp::makeDatabaseRotating (std::string const& name, std::shared_ptr writableBackend, std::shared_ptr archiveBackend) const { - std::unique_ptr fastBackend ( - (setup_.ephemeralNodeDatabase.size() > 0) - ? NodeStore::Manager::instance().make_Backend (setup_.ephemeralNodeDatabase, - scheduler_, journal_) : nullptr); - return NodeStore::Manager::instance().make_DatabaseRotating ("NodeStore.main", scheduler_, - readThreads, writableBackend, archiveBackend, - std::move (fastBackend), nodeStoreJournal_); + readThreads, writableBackend, archiveBackend, nodeStoreJournal_); } void @@ -680,7 +673,6 @@ setup_SHAMapStore (Config const& c) setup.ledgerHistory = c.LEDGER_HISTORY; setup.nodeDatabase = c[ConfigSection::nodeDatabase ()]; - setup.ephemeralNodeDatabase = c[ConfigSection::tempNodeDatabase ()]; setup.databasePath = c.legacy("database_path"); get_if_exists (sec, "delete_batch", setup.deleteBatch); diff --git a/src/ripple/core/ConfigSections.h b/src/ripple/core/ConfigSections.h index 31257a219f..726a0081e8 100644 --- a/src/ripple/core/ConfigSections.h +++ b/src/ripple/core/ConfigSections.h @@ -28,7 +28,6 @@ namespace ripple { struct ConfigSection { static std::string nodeDatabase () { return "node_db"; } - static std::string tempNodeDatabase () { return "temp_db"; } static std::string importNodeDatabase () { return "import_db"; } }; diff --git a/src/ripple/nodestore/Manager.h b/src/ripple/nodestore/Manager.h index d6fb6ab55e..9ee13f9994 100644 --- a/src/ripple/nodestore/Manager.h +++ b/src/ripple/nodestore/Manager.h @@ -87,8 +87,7 @@ public: std::unique_ptr make_Database (std::string const& name, Scheduler& scheduler, beast::Journal journal, int readThreads, - Section const& backendParameters, - Section fastBackendParameters = Section()) = 0; + Section const& backendParameters) = 0; virtual std::unique_ptr @@ -96,7 +95,6 @@ public: Scheduler& scheduler, std::int32_t readThreads, std::shared_ptr writableBackend, std::shared_ptr archiveBackend, - std::unique_ptr fastBackend, beast::Journal journal) = 0; }; diff --git a/src/ripple/nodestore/impl/DatabaseImp.h b/src/ripple/nodestore/impl/DatabaseImp.h index 5152b10c5d..a47cfcf72a 100644 --- a/src/ripple/nodestore/impl/DatabaseImp.h +++ b/src/ripple/nodestore/impl/DatabaseImp.h @@ -45,8 +45,6 @@ private: Scheduler& m_scheduler; // Persistent key/value storage. std::unique_ptr m_backend; - // Larger key/value storage, but not necessarily persistent. - std::unique_ptr m_fastBackend; protected: // Positive cache TaggedCache m_cache; @@ -67,12 +65,10 @@ public: Scheduler& scheduler, int readThreads, std::unique_ptr backend, - std::unique_ptr fastBackend, beast::Journal journal) : m_journal (journal) , m_scheduler (scheduler) , m_backend (std::move (backend)) - , m_fastBackend (std::move (fastBackend)) , m_cache ("NodeStore", cacheTargetSize, cacheTargetSeconds, get_seconds_clock (), deprecatedLogs().journal("TaggedCache")) , m_negCache ("NodeStore", get_seconds_clock (), @@ -117,11 +113,6 @@ public: m_backend->close(); m_backend = nullptr; } - if (m_fastBackend) - { - m_fastBackend->close(); - m_fastBackend = nullptr; - } } //------------------------------------------------------------------------------ @@ -204,20 +195,8 @@ public: // Check the database(s). - bool foundInFastBackend = false; report.wentToDisk = true; - // Check the fast backend database if we have one - // - if (m_fastBackend != nullptr) - { - obj = fetchInternal (*m_fastBackend, hash); - - // If we found the object, avoid storing it again later. - if (obj != nullptr) - foundInFastBackend = true; - } - // Are we still without an object? // if (obj == nullptr) @@ -246,23 +225,10 @@ public: // m_cache.canonicalize (hash, obj); - if (! foundInFastBackend) - { - // If we have a fast back end, store it there for later. - // - if (m_fastBackend != nullptr) - { - m_fastBackend->store (obj); - ++m_storeCount; - if (obj) - m_storeSize += obj->getData().size(); - } - - // Since this was a 'hard' fetch, we will log it. - // - if (m_journal.trace) m_journal.trace << - "HOS: " << hash << " fetch: in db"; - } + // Since this was a 'hard' fetch, we will log it. + // + if (m_journal.trace) m_journal.trace << + "HOS: " << hash << " fetch: in db"; } return obj; @@ -334,14 +300,6 @@ public: m_storeSize += object->getData().size(); m_negCache.erase (hash); - - if (m_fastBackend) - { - m_fastBackend->store (object); - ++m_storeCount; - if (object) - m_storeSize += object->getData().size(); - } } //------------------------------------------------------------------------------ diff --git a/src/ripple/nodestore/impl/DatabaseRotatingImp.h b/src/ripple/nodestore/impl/DatabaseRotatingImp.h index ebcf123f23..7c02490e97 100644 --- a/src/ripple/nodestore/impl/DatabaseRotatingImp.h +++ b/src/ripple/nodestore/impl/DatabaseRotatingImp.h @@ -52,11 +52,9 @@ public: int readThreads, std::shared_ptr writableBackend, std::shared_ptr archiveBackend, - std::unique_ptr fastBackend, beast::Journal journal) : DatabaseImp (name, scheduler, readThreads, - std::unique_ptr (), std::move (fastBackend), - journal) + std::unique_ptr (), journal) , writableBackend_ (writableBackend) , archiveBackend_ (archiveBackend) {} diff --git a/src/ripple/nodestore/impl/ManagerImp.cpp b/src/ripple/nodestore/impl/ManagerImp.cpp index 028af98455..f0d5f093b5 100644 --- a/src/ripple/nodestore/impl/ManagerImp.cpp +++ b/src/ripple/nodestore/impl/ManagerImp.cpp @@ -91,19 +91,13 @@ ManagerImp::make_Database ( Scheduler& scheduler, beast::Journal journal, int readThreads, - Section const& backendParameters, - Section fastBackendParameters) + Section const& backendParameters) { std::unique_ptr backend (make_Backend ( backendParameters, scheduler, journal)); - std::unique_ptr fastBackend ( - (fastBackendParameters.size () > 0) - ? make_Backend (fastBackendParameters, scheduler, journal) - : nullptr); - return std::make_unique (name, scheduler, readThreads, - std::move (backend), std::move (fastBackend), journal); + std::move (backend), journal); } std::unique_ptr @@ -113,12 +107,10 @@ ManagerImp::make_DatabaseRotating ( std::int32_t readThreads, std::shared_ptr writableBackend, std::shared_ptr archiveBackend, - std::unique_ptr fastBackend, beast::Journal journal) { return std::make_unique (name, scheduler, - readThreads, writableBackend, archiveBackend, - std::move (fastBackend), journal); + readThreads, writableBackend, archiveBackend, journal); } Factory* diff --git a/src/ripple/nodestore/impl/ManagerImp.h b/src/ripple/nodestore/impl/ManagerImp.h index ecfd6224c0..f4e87852ac 100644 --- a/src/ripple/nodestore/impl/ManagerImp.h +++ b/src/ripple/nodestore/impl/ManagerImp.h @@ -67,8 +67,7 @@ public: Scheduler& scheduler, beast::Journal journal, int readThreads, - Section const& backendParameters, - Section fastBackendParameters) override; + Section const& backendParameters) override; std::unique_ptr make_DatabaseRotating ( @@ -77,7 +76,6 @@ public: std::int32_t readThreads, std::shared_ptr writableBackend, std::shared_ptr archiveBackend, - std::unique_ptr fastBackend, beast::Journal journal) override; }; diff --git a/src/ripple/nodestore/tests/Database.test.cpp b/src/ripple/nodestore/tests/Database.test.cpp index 2168a72196..dccf75781f 100644 --- a/src/ripple/nodestore/tests/Database.test.cpp +++ b/src/ripple/nodestore/tests/Database.test.cpp @@ -87,7 +87,6 @@ public: //-------------------------------------------------------------------------- void testNodeStore (std::string const& type, - bool const useEphemeralDatabase, bool const testPersistence, std::int64_t const seedValue, int numObjectsToTest = 2000) @@ -95,8 +94,6 @@ public: DummyScheduler scheduler; std::string s = "NodeStore backend '" + type + "'"; - if (useEphemeralDatabase) - s += " (with ephemeral database)"; testcase (s); @@ -105,14 +102,6 @@ public: nodeParams.set ("type", type); nodeParams.set ("path", node_db.getFullPathName ().toStdString ()); - beast::UnitTestUtilities::TempDirectory temp_db ("temp_db"); - Section tempParams; - if (useEphemeralDatabase) - { - tempParams.set ("type", type); - tempParams.set ("path", temp_db.getFullPathName ().toStdString ()); - } - // Create a batch Batch batch; createPredictableBatch (batch, numObjectsToTest, seedValue); @@ -122,7 +111,7 @@ public: { // Open the database std::unique_ptr db = Manager::instance().make_Database ( - "test", scheduler, j, 2, nodeParams, tempParams); + "test", scheduler, j, 2, nodeParams); // Write the batch storeBatch (*db, batch); @@ -159,37 +148,17 @@ public: std::sort (copy.begin (), copy.end (), NodeObject::LessThan ()); expect (areBatchesEqual (batch, copy), "Should be equal"); } - - if (useEphemeralDatabase) - { - // Verify the ephemeral db - std::unique_ptr db = Manager::instance().make_Database ("test", - scheduler, j, 2, tempParams, Section ()); - - // Read it back in - Batch copy; - fetchCopyOfBatch (*db, ©, batch); - - // Canonicalize the source and destination batches - std::sort (batch.begin (), batch.end (), NodeObject::LessThan ()); - std::sort (copy.begin (), copy.end (), NodeObject::LessThan ()); - expect (areBatchesEqual (batch, copy), "Should be equal"); - } } } //-------------------------------------------------------------------------- - void runBackendTests (bool useEphemeralDatabase, std::int64_t const seedValue) + void runBackendTests (std::int64_t const seedValue) { - testNodeStore ("nudb", useEphemeralDatabase, true, seedValue); + testNodeStore ("nudb", true, seedValue); #if RIPPLE_ROCKSDB_AVAILABLE - testNodeStore ("rocksdb", useEphemeralDatabase, true, seedValue); - #endif - - #if RIPPLE_ENABLE_SQLITE_BACKEND_TESTS - testNodeStore ("sqlite", useEphemeralDatabase, true, seedValue); + testNodeStore ("rocksdb", true, seedValue); #endif } @@ -214,11 +183,9 @@ public: { std::int64_t const seedValue = 50; - testNodeStore ("memory", false, false, seedValue); + testNodeStore ("memory", false, seedValue); - runBackendTests (false, seedValue); - - runBackendTests (true, seedValue); + runBackendTests (seedValue); runImportTests (seedValue); }