Ledger acquire fixes/cleanups/logging

* Inbound ledger and SHAMapAddNode cleanup
    * Log acquire stats
    * Fix progress logic
    * Remove ledgers we no longer need to acquire
    * Stash stale state data in our fetch pack, it can still be useful
    * Stash in fetch pack if acquire terminated while job was pending
    * Account for duplicate/invalid nodes in a few cases previously missed
    * Dispatch each InboundLedger once (not per data)
    * Trigger only the "best" peer
    * Don't call tryAdvance on failed acquires
This commit is contained in:
JoelKatz
2013-12-14 20:16:54 -08:00
committed by Vinnie Falco
parent 9bdb0774ad
commit b2dbe8ef83
14 changed files with 515 additions and 294 deletions

View File

@@ -50,7 +50,7 @@ public:
, mLastCloseConvergeTime (1000 * LEDGER_IDLE_INTERVAL)
, mLastCloseTime (0)
, mLastValidationTime (0)
, mFetchPack ("FetchPack", 2048, 20)
, mFetchPack ("FetchPack", 65536, 45)
, mFetchSeq (0)
, mLastLoadBase (256)
, mLastLoadFactor (256)
@@ -3066,6 +3066,11 @@ int NetworkOPsImp::getFetchSize ()
void NetworkOPsImp::gotFetchPack (bool progress, uint32 seq)
{
// FIXME: Calling this function more than once will result in
// InboundLedgers::gotFetchPack being called more than once
// which is expensive. A flag should track whether we've already dispatched
getApp().getJobQueue ().addJob (jtLEDGER_DATA, "gotFetchPack",
BIND_TYPE (&InboundLedgers::gotFetchPack, &getApp().getInboundLedgers (), P_1));
}