mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Speed up access to ledger index value that can be deleted.
This commit is contained in:
committed by
Nik Bougalis
parent
f3c1f63444
commit
9430f3665b
@@ -204,8 +204,8 @@ SHAMapStoreImp::SHAMapStoreImp (Setup const& setup,
|
||||
, scheduler_ (scheduler)
|
||||
, journal_ (journal)
|
||||
, nodeStoreJournal_ (nodeStoreJournal)
|
||||
, database_ (nullptr)
|
||||
, transactionMaster_ (transactionMaster)
|
||||
, canDelete_ (0)
|
||||
{
|
||||
if (setup_.deleteInterval)
|
||||
{
|
||||
@@ -326,17 +326,17 @@ SHAMapStoreImp::run()
|
||||
lastRotated = validatedSeq;
|
||||
state_db_.setLastRotated (lastRotated);
|
||||
}
|
||||
LedgerIndex canDelete = std::numeric_limits <LedgerIndex>::max();
|
||||
canDelete_ = std::numeric_limits <LedgerIndex>::max();
|
||||
if (setup_.advisoryDelete)
|
||||
canDelete = state_db_.getCanDelete();
|
||||
canDelete_ = state_db_.getCanDelete();
|
||||
|
||||
// will delete up to (not including) lastRotated)
|
||||
if (validatedSeq >= lastRotated + setup_.deleteInterval
|
||||
&& canDelete >= lastRotated - 1)
|
||||
&& canDelete_ >= lastRotated - 1)
|
||||
{
|
||||
journal_.debug << "rotating validatedSeq " << validatedSeq
|
||||
<< " lastRotated " << lastRotated << " deleteInterval "
|
||||
<< setup_.deleteInterval << " canDelete " << canDelete;
|
||||
<< setup_.deleteInterval << " canDelete_ " << canDelete_;
|
||||
|
||||
switch (health())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user