|
xrpld
|
#include <SHAMapStoreImp.h>


Classes | |
| class | SavedStateDB |
Public Member Functions | |
| SHAMapStoreImp (Application &app, node_store::Scheduler &scheduler, beast::Journal journal) | |
| std::uint32_t | clampFetchDepth (std::uint32_t fetchDepth) const override |
| std::unique_ptr< node_store::Database > | makeNodeStore (int readThreads) override |
| LedgerIndex | setCanDelete (LedgerIndex seq) override |
| Highest ledger that may be deleted. | |
| bool | advisoryDelete () const override |
| Whether advisory delete is enabled. | |
| LedgerIndex | getLastRotated () override |
| Maximum ledger that has been deleted, or will be deleted if currently in the act of online deletion. | |
| LedgerIndex | getCanDelete () override |
| Highest ledger that may be deleted. | |
| void | onLedgerClosed (std::shared_ptr< Ledger const > const &ledger) override |
| Called by LedgerMaster every time a ledger validates. | |
| bool | rendezvous (std::optional< std::chrono::milliseconds > const &timeout={}) const override |
| int | fdRequired () const override |
| Returns the number of file descriptors that are needed. | |
| std::optional< LedgerIndex > | minimumOnline () const override |
| The minimum ledger to try and maintain in our database. | |
| void | start () override |
| void | stop () override |
Private Types | |
| enum class | HealthResult { Stopping , Expired , KeepGoing } |
| This is a health check for online deletion that waits until xrpld is stable before returning. More... | |
Private Member Functions | |
| bool | copyNode (std::uint64_t &nodeCount, SHAMapTreeNode const &node) |
| void | run () |
| void | dbPaths () |
| std::unique_ptr< node_store::Backend > | makeBackendRotating (std::string path=std::string()) |
| template<class CacheInstance> | |
| bool | freshenCache (CacheInstance &cache) |
| void | clearSql (LedgerIndex lastRotated, std::string const &tableName, std::function< std::optional< LedgerIndex >()> const &getMinSeq, std::function< void(LedgerIndex)> const &deleteBeforeSeq) |
| delete from sqlite table in batches to not lock the db excessively. | |
| void | clearCaches (LedgerIndex validatedSeq) |
| void | freshenCaches () |
| void | clearPrior (LedgerIndex lastRotated) |
| HealthResult | healthWait () |
Static Private Attributes | |
| static std::uint32_t const | kMinimumDeletionInterval = 256 |
| static std::uint32_t const | kMinimumDeletionIntervalSa = 8 |
| static constexpr auto | kNodeStoreName = "NodeStore" |
Definition at line 37 of file SHAMapStoreImp.h.
|
strongprivate |
This is a health check for online deletion that waits until xrpld is stable before returning.
It returns an indication of whether the server is stopping, or if this attempt should be abandoned.
| Enumerator | |
|---|---|
| Stopping | |
| Expired | |
| KeepGoing | |
Definition at line 241 of file SHAMapStoreImp.h.
| xrpl::SHAMapStoreImp::SHAMapStoreImp | ( | Application & | app, |
| node_store::Scheduler & | scheduler, | ||
| beast::Journal | journal ) |
Definition at line 98 of file SHAMapStoreImp.cpp.
|
overridevirtual |
Implements xrpl::SHAMapStore.
Definition at line 138 of file SHAMapStoreImp.h.
|
overridevirtual |
Implements xrpl::SHAMapStore.
Definition at line 189 of file SHAMapStoreImp.cpp.
|
overridevirtual |
Highest ledger that may be deleted.
Implements xrpl::SHAMapStore.
Definition at line 147 of file SHAMapStoreImp.h.
|
overridevirtual |
Whether advisory delete is enabled.
Implements xrpl::SHAMapStore.
Definition at line 155 of file SHAMapStoreImp.h.
|
overridevirtual |
Maximum ledger that has been deleted, or will be deleted if currently in the act of online deletion.
Implements xrpl::SHAMapStore.
Definition at line 163 of file SHAMapStoreImp.h.
|
overridevirtual |
Highest ledger that may be deleted.
Implements xrpl::SHAMapStore.
Definition at line 171 of file SHAMapStoreImp.h.
|
overridevirtual |
Called by LedgerMaster every time a ledger validates.
Implements xrpl::SHAMapStore.
Definition at line 249 of file SHAMapStoreImp.cpp.
|
nodiscardoverridevirtual |
Implements xrpl::SHAMapStore.
Definition at line 261 of file SHAMapStoreImp.cpp.
|
overridevirtual |
Returns the number of file descriptors that are needed.
Implements xrpl::SHAMapStore.
Definition at line 278 of file SHAMapStoreImp.cpp.
|
overridevirtual |
The minimum ledger to try and maintain in our database.
This defines the lower bound for attempting to acquire historical ledgers over the peer to peer network.
If online_delete is enabled, then each time online_delete executes and just prior to clearing SQL databases of historical ledgers, move the value forward to one past the greatest ledger being deleted. This minimizes fetching of ledgers that are in the process of being deleted. Without online_delete or before online_delete is executed, this value is always the minimum value persisted in the ledger database, if any.
Implements xrpl::SHAMapStore.
Definition at line 882 of file SHAMapStoreImp.cpp.
|
private |
Definition at line 284 of file SHAMapStoreImp.cpp.
|
private |
Definition at line 315 of file SHAMapStoreImp.cpp.
|
private |
Definition at line 506 of file SHAMapStoreImp.cpp.
|
private |
Definition at line 605 of file SHAMapStoreImp.cpp.
|
private |
Definition at line 202 of file SHAMapStoreImp.h.
|
private |
delete from sqlite table in batches to not lock the db excessively.
Pause briefly to extend access time to other users. Call with mutex object unlocked.
Definition at line 630 of file SHAMapStoreImp.cpp.
|
private |
Definition at line 679 of file SHAMapStoreImp.cpp.
|
private |
Definition at line 689 of file SHAMapStoreImp.cpp.
|
private |
Definition at line 698 of file SHAMapStoreImp.cpp.
|
nodiscardprivate |
Definition at line 740 of file SHAMapStoreImp.cpp.
|
overridevirtual |
Implements xrpl::SHAMapStore.
Definition at line 247 of file SHAMapStoreImp.h.
|
overridevirtual |
Implements xrpl::SHAMapStore.
Definition at line 868 of file SHAMapStoreImp.cpp.
|
private |
Definition at line 69 of file SHAMapStoreImp.h.
|
private |
Definition at line 72 of file SHAMapStoreImp.h.
|
private |
Definition at line 74 of file SHAMapStoreImp.h.
|
private |
Definition at line 76 of file SHAMapStoreImp.h.
|
staticprivate |
Definition at line 78 of file SHAMapStoreImp.h.
|
staticprivate |
Definition at line 80 of file SHAMapStoreImp.h.
|
private |
Definition at line 82 of file SHAMapStoreImp.h.
|
private |
Definition at line 84 of file SHAMapStoreImp.h.
|
private |
Definition at line 85 of file SHAMapStoreImp.h.
|
private |
Definition at line 86 of file SHAMapStoreImp.h.
|
private |
Definition at line 87 of file SHAMapStoreImp.h.
|
private |
Definition at line 88 of file SHAMapStoreImp.h.
|
private |
Definition at line 89 of file SHAMapStoreImp.h.
|
private |
Definition at line 90 of file SHAMapStoreImp.h.
|
private |
Definition at line 95 of file SHAMapStoreImp.h.
|
private |
Definition at line 97 of file SHAMapStoreImp.h.
|
mutableprivate |
Definition at line 98 of file SHAMapStoreImp.h.
|
mutableprivate |
Definition at line 99 of file SHAMapStoreImp.h.
|
mutableprivate |
Definition at line 100 of file SHAMapStoreImp.h.
|
private |
Definition at line 101 of file SHAMapStoreImp.h.
|
private |
Definition at line 102 of file SHAMapStoreImp.h.
|
private |
Definition at line 103 of file SHAMapStoreImp.h.
|
private |
Definition at line 104 of file SHAMapStoreImp.h.
|
private |
Definition at line 106 of file SHAMapStoreImp.h.
|
private |
Definition at line 107 of file SHAMapStoreImp.h.
|
private |
Definition at line 108 of file SHAMapStoreImp.h.
|
private |
Definition at line 109 of file SHAMapStoreImp.h.
|
private |
Definition at line 110 of file SHAMapStoreImp.h.
|
private |
If the node is out of sync, or any recent ledgers are not available during an online_delete healthWait() call, sleep the thread for this time, and continue checking until recovery.
See also: "recovery_wait_seconds" in xrpld-example.cfg
Definition at line 117 of file SHAMapStoreImp.h.
|
private |
If the rotation stays "unhealthy" for a very long time, the process is aborted, and tried again later.
This value represents the number of ledgers that must be validated without making rotation progress before the process is aborted.
Definition at line 123 of file SHAMapStoreImp.h.
|
private |
Definition at line 127 of file SHAMapStoreImp.h.
|
private |
Definition at line 128 of file SHAMapStoreImp.h.
|
private |
Definition at line 129 of file SHAMapStoreImp.h.
|
private |
Definition at line 130 of file SHAMapStoreImp.h.
|
staticconstexprprivate |
Definition at line 132 of file SHAMapStoreImp.h.