mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
SHAMapStore Online Delete (RIPD-415):
Makes rippled configurable to support deletion of all data in its key-value store (nodestore) and ledger and transaction SQLite databases based on validated ledger sequence numbers. All records from a specified ledger and forward shall remain available in the key-value store and SQLite, and all data prior to that specific ledger may be deleted. Additionally, the administrator may require that an RPC command be executed to enable deletion. This is to align data deletion with local policy.
This commit is contained in:
committed by
Nik Bougalis
parent
b44974677e
commit
02529a0fc2
@@ -18,24 +18,21 @@
|
||||
//==============================================================================
|
||||
|
||||
#include <ripple/app/data/DatabaseCon.h>
|
||||
#include <ripple/core/Config.h>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
DatabaseCon::DatabaseCon (std::string const& strName, const char* initStrings[], int initCount)
|
||||
DatabaseCon::DatabaseCon (Setup const& setup,
|
||||
std::string const& strName,
|
||||
const char* initStrings[],
|
||||
int initCount)
|
||||
{
|
||||
// VFALCO TODO remove this dependency on the config by making it the caller's
|
||||
// responsibility to pass in the path. Add a member function to Application
|
||||
// or Config to compute this path.
|
||||
//
|
||||
auto const startUp = getConfig ().START_UP;
|
||||
auto const useTempFiles // Use temporary files or regular DB files?
|
||||
= getConfig ().RUN_STANDALONE &&
|
||||
startUp != Config::LOAD &&
|
||||
startUp != Config::LOAD_FILE &&
|
||||
startUp != Config::REPLAY;
|
||||
= setup.standAlone &&
|
||||
setup.startUp != Config::LOAD &&
|
||||
setup.startUp != Config::LOAD_FILE &&
|
||||
setup.startUp != Config::REPLAY;
|
||||
boost::filesystem::path pPath = useTempFiles
|
||||
? "" : (getConfig ().DATA_DIR / strName);
|
||||
? "" : (setup.dataDir / strName);
|
||||
|
||||
mDatabase = new SqliteDatabase (pPath.string ().c_str ());
|
||||
mDatabase->connect ();
|
||||
@@ -50,4 +47,18 @@ DatabaseCon::~DatabaseCon ()
|
||||
delete mDatabase;
|
||||
}
|
||||
|
||||
DatabaseCon::Setup
|
||||
setup_DatabaseCon (Config const& c)
|
||||
{
|
||||
DatabaseCon::Setup setup;
|
||||
|
||||
if (c.nodeDatabase["online_delete"].isNotEmpty())
|
||||
setup.onlineDelete = c.nodeDatabase["online_delete"].getIntValue();
|
||||
setup.startUp = c.START_UP;
|
||||
setup.standAlone = c.RUN_STANDALONE;
|
||||
setup.dataDir = c.DATA_DIR;
|
||||
|
||||
return setup;
|
||||
}
|
||||
|
||||
} // ripple
|
||||
|
||||
Reference in New Issue
Block a user