mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 11:05:54 +00:00
Make sure we keep publishing ledgers while filling a gap from the database.
This commit is contained in:
@@ -359,6 +359,8 @@ void LedgerMaster::tryFill (Ledger::pointer ledger)
|
|||||||
{
|
{
|
||||||
boost::recursive_mutex::scoped_lock ml (mLock);
|
boost::recursive_mutex::scoped_lock ml (mLock);
|
||||||
mCompleteLedgers.setRange (minHas, maxHas);
|
mCompleteLedgers.setRange (minHas, maxHas);
|
||||||
|
mFillInProgress = false;
|
||||||
|
tryAdvance();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -569,7 +571,7 @@ void LedgerMaster::advanceThread()
|
|||||||
std::list<Ledger::pointer> pubLedgers = findNewLedgersToPublish (sl);
|
std::list<Ledger::pointer> pubLedgers = findNewLedgersToPublish (sl);
|
||||||
if (pubLedgers.empty())
|
if (pubLedgers.empty())
|
||||||
{
|
{
|
||||||
if (!getConfig().RUN_STANDALONE && !getApp().getFeeTrack().isLoadedLocal() &&
|
if (!mFillInProgress && !getConfig().RUN_STANDALONE && !getApp().getFeeTrack().isLoadedLocal() &&
|
||||||
(getApp().getJobQueue().getJobCount(jtPUBOLDLEDGER) < 10) &&
|
(getApp().getJobQueue().getJobCount(jtPUBOLDLEDGER) < 10) &&
|
||||||
(mValidLedger->getLedgerSeq() == mPubLedger->getLedgerSeq()))
|
(mValidLedger->getLedgerSeq() == mPubLedger->getLedgerSeq()))
|
||||||
{ // We are in sync, so can acquire
|
{ // We are in sync, so can acquire
|
||||||
@@ -610,7 +612,13 @@ void LedgerMaster::advanceThread()
|
|||||||
assert(ledger->getLedgerSeq() == missing);
|
assert(ledger->getLedgerSeq() == missing);
|
||||||
WriteLog (lsTRACE, LedgerMaster) << "tryAdvance acquired " << ledger->getLedgerSeq();
|
WriteLog (lsTRACE, LedgerMaster) << "tryAdvance acquired " << ledger->getLedgerSeq();
|
||||||
setFullLedger(ledger, false, false);
|
setFullLedger(ledger, false, false);
|
||||||
tryFill(ledger);
|
if (Ledger::getHashByIndex(ledger->getLedgerSeq() - 1) == ledger->getParentHash())
|
||||||
|
{ // Previous ledger is in DB
|
||||||
|
sl.lock();
|
||||||
|
mFillInProgress = true;
|
||||||
|
getApp().getJobQueue().addJob(jtADVANCE, "tryFill", BIND_TYPE (&LedgerMaster::tryFill, this, ledger));
|
||||||
|
sl.unlock();
|
||||||
|
}
|
||||||
progress = true;
|
progress = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ public:
|
|||||||
, mMinValidations (0)
|
, mMinValidations (0)
|
||||||
, mLastValidateSeq (0)
|
, mLastValidateSeq (0)
|
||||||
, mAdvanceThread (false)
|
, mAdvanceThread (false)
|
||||||
|
, mFillInProgress (false)
|
||||||
, mPathFindThread (false)
|
, mPathFindThread (false)
|
||||||
, mPathFindNewLedger (false)
|
, mPathFindNewLedger (false)
|
||||||
, mPathFindNewRequest (false)
|
, mPathFindNewRequest (false)
|
||||||
@@ -219,6 +220,7 @@ private:
|
|||||||
|
|
||||||
std::list<Ledger::pointer> mPubLedgers; // List of ledgers to publish
|
std::list<Ledger::pointer> mPubLedgers; // List of ledgers to publish
|
||||||
bool mAdvanceThread; // Publish thread is running
|
bool mAdvanceThread; // Publish thread is running
|
||||||
|
bool mFillInProgress;
|
||||||
|
|
||||||
bool mPathFindThread; // Pathfind thread is running
|
bool mPathFindThread; // Pathfind thread is running
|
||||||
bool mPathFindNewLedger;
|
bool mPathFindNewLedger;
|
||||||
|
|||||||
Reference in New Issue
Block a user