From ff7dc0b446ff6c08b26370b5595e6eb73913d181 Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Sun, 15 Mar 2015 16:11:49 -0700 Subject: [PATCH] Reduce chatty log outputs --- src/ripple/app/consensus/LedgerConsensus.cpp | 6 +++--- src/ripple/app/ledger/LedgerMaster.cpp | 3 ++- src/ripple/app/ledger/LedgerTiming.cpp | 2 +- src/ripple/app/ledger/README.md | 8 ++++---- src/ripple/app/misc/NetworkOPs.cpp | 6 +++--- src/ripple/app/peers/PeerSet.cpp | 3 ++- src/ripple/app/tx/TransactionAcquire.cpp | 2 +- src/ripple/overlay/impl/PeerImp.cpp | 2 +- src/ripple/shamap/impl/SHAMap.cpp | 2 +- 9 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/ripple/app/consensus/LedgerConsensus.cpp b/src/ripple/app/consensus/LedgerConsensus.cpp index 280b42678b..c466ea9116 100644 --- a/src/ripple/app/consensus/LedgerConsensus.cpp +++ b/src/ripple/app/consensus/LedgerConsensus.cpp @@ -385,7 +385,7 @@ public: { leaveConsensus(); WriteLog (lsERROR, LedgerConsensus) << - "Missind node processing complete map " << mn; + "Missing node processing complete map " << mn; throw; } } @@ -393,7 +393,7 @@ public: void mapCompleteInternal (uint256 const& hash, std::shared_ptr const& map, bool acquired) { - CondLog (acquired, lsINFO, LedgerConsensus) + CondLog (acquired, lsDEBUG, LedgerConsensus) << "We have acquired TXS " << hash; if (!map) // If the map was invalid @@ -2090,7 +2090,7 @@ void applyTransactions (std::shared_ptr const& set, if (!checkLedger->hasTransaction (item->getTag ())) { // Then try to apply the transaction to applyLedger - WriteLog (lsINFO, LedgerConsensus) << + WriteLog (lsDEBUG, LedgerConsensus) << "Processing candidate transaction: " << item->getTag (); try { diff --git a/src/ripple/app/ledger/LedgerMaster.cpp b/src/ripple/app/ledger/LedgerMaster.cpp index 5cfb393722..ef7a8a132d 100644 --- a/src/ripple/app/ledger/LedgerMaster.cpp +++ b/src/ripple/app/ledger/LedgerMaster.cpp @@ -46,6 +46,7 @@ namespace ripple { #define MIN_VALIDATION_RATIO 150 // 150/256ths of validations of previous ledger #define MAX_LEDGER_GAP 100 // Don't catch up more than 100 ledgers (cannot exceed 256) +#define MAX_LEDGER_AGE_ACQUIRE 60 // Don't acquire history if ledger is too old class LedgerMasterImp : public LedgerMaster @@ -936,7 +937,7 @@ public: if (!standalone_ && !getApp().getFeeTrack().isLoadedLocal() && (getApp().getJobQueue().getJobCount(jtPUBOLDLEDGER) < 10) && (mValidLedgerSeq == mPubLedgerSeq) && - (getValidatedLedgerAge() < 60)) + (getValidatedLedgerAge() < MAX_LEDGER_AGE_ACQUIRE)) { // We are in sync, so can acquire std::uint32_t missing; { diff --git a/src/ripple/app/ledger/LedgerTiming.cpp b/src/ripple/app/ledger/LedgerTiming.cpp index 6ff9d21f86..48190f3528 100644 --- a/src/ripple/app/ledger/LedgerTiming.cpp +++ b/src/ripple/app/ledger/LedgerTiming.cpp @@ -130,7 +130,7 @@ bool ContinuousLedgerTiming::haveConsensus ( // If 80% of current proposers (plus us) agree on a set, we have consensus if (((currentAgree * 100 + 100) / (currentProposers + 1)) > 80) { - CondLog (forReal, lsINFO, LedgerTiming) << "normal consensus"; + CondLog (forReal, lsDEBUG, LedgerTiming) << "normal consensus"; failed = false; return true; } diff --git a/src/ripple/app/ledger/README.md b/src/ripple/app/ledger/README.md index 879c41cec1..b132688bd3 100644 --- a/src/ripple/app/ledger/README.md +++ b/src/ripple/app/ledger/README.md @@ -410,22 +410,22 @@ ledger and then attempts to resume a continuous stream. ## Implementation ## -LedgerMaster::doAdvance is invoked when work may need to be done to +`LedgerMaster::doAdvance` is invoked when work may need to be done to publish ledgers to clients. This code loops until it cannot make further progress. -LedgerMaster::findNewLedgersToPublish is called first. If the last +`LedgerMaster::findNewLedgersToPublish` is called first. If the last fully-valid ledger's sequence number is greater than the last published ledger's sequence number, it attempts to publish those ledgers, retrieving them if needed. -If there are no new ledgers to publish, doAdvance determines if it can +If there are no new ledgers to publish, `doAdvance` determines if it can backfill history. If the publication is not caught up, bakfilling is not attempted to conserve resources. If history can be backfilled, the missing ledger with the highest sequence number is retrieved first. If a historical ledger is retrieved, -and its predecessor is in the database, tryFill is invoked to update +and its predecessor is in the database, `tryFill` is invoked to update the list of resident ledgers. --- diff --git a/src/ripple/app/misc/NetworkOPs.cpp b/src/ripple/app/misc/NetworkOPs.cpp index 11a8a23c03..a1425cf3a8 100644 --- a/src/ripple/app/misc/NetworkOPs.cpp +++ b/src/ripple/app/misc/NetworkOPs.cpp @@ -1040,7 +1040,7 @@ Transaction::pointer NetworkOPsImp::processTransactionCb ( if (r == tesSUCCESS) { - m_journal.info << "Transaction is now included in open ledger"; + m_journal.debug << "Transaction is now included in open ledger"; trans->setStatus (INCLUDED); // VFALCO NOTE The value of trans can be changed here! @@ -1702,7 +1702,7 @@ SHAMapAddNode NetworkOPsImp::gotTXData ( if (!mConsensus) { - m_journal.warning << "Got TX data with no consensus object"; + m_journal.debug << "Got TX data with no consensus object"; return SHAMapAddNode (); } @@ -2792,7 +2792,7 @@ void NetworkOPsImp::pubAccountTransaction ( } } } - m_journal.info << "pubAccountTransaction:" << + m_journal.trace << "pubAccountTransaction:" << " iProposed=" << iProposed << " iAccepted=" << iAccepted; diff --git a/src/ripple/app/peers/PeerSet.cpp b/src/ripple/app/peers/PeerSet.cpp index d3edca127b..0b055128f7 100644 --- a/src/ripple/app/peers/PeerSet.cpp +++ b/src/ripple/app/peers/PeerSet.cpp @@ -90,7 +90,8 @@ void PeerSet::invokeOnTimer () if (!isProgress()) { ++mTimeouts; - WriteLog (lsWARNING, InboundLedger) << "Timeout(" << mTimeouts << ") pc=" << mPeers.size () << " acquiring " << mHash; + WriteLog (lsDEBUG, InboundLedger) << "Timeout(" << mTimeouts + << ") pc=" << mPeers.size () << " acquiring " << mHash; onTimer (false, sl); } else diff --git a/src/ripple/app/tx/TransactionAcquire.cpp b/src/ripple/app/tx/TransactionAcquire.cpp index 423012dcd8..1866a4019d 100644 --- a/src/ripple/app/tx/TransactionAcquire.cpp +++ b/src/ripple/app/tx/TransactionAcquire.cpp @@ -71,7 +71,7 @@ void TransactionAcquire::done () } else { - WriteLog (lsINFO, TransactionAcquire) << "Acquired TX set " << mHash; + WriteLog (lsDEBUG, TransactionAcquire) << "Acquired TX set " << mHash; mMap->setImmutable (); map = mMap; } diff --git a/src/ripple/overlay/impl/PeerImp.cpp b/src/ripple/overlay/impl/PeerImp.cpp index 41a1bd2f5f..bc6b757cd5 100644 --- a/src/ripple/overlay/impl/PeerImp.cpp +++ b/src/ripple/overlay/impl/PeerImp.cpp @@ -1654,7 +1654,7 @@ PeerImp::getLedger (std::shared_ptr const& m) return; } - p_journal_.error << + p_journal_.debug << "GetLedger: Can't provide map "; charge (Resource::feeInvalidRequest); return; diff --git a/src/ripple/shamap/impl/SHAMap.cpp b/src/ripple/shamap/impl/SHAMap.cpp index a504aa256d..fd11abae07 100644 --- a/src/ripple/shamap/impl/SHAMap.cpp +++ b/src/ripple/shamap/impl/SHAMap.cpp @@ -870,7 +870,7 @@ SHAMap::updateGiveItem (std::shared_ptr const& item, if (!node->setItem (item, !isTransaction ? SHAMapTreeNode::tnACCOUNT_STATE : (hasMeta ? SHAMapTreeNode::tnTRANSACTION_MD : SHAMapTreeNode::tnTRANSACTION_NM))) { - if (journal_.warning) journal_.warning << + journal_.trace << "SHAMap setItem, no change"; return true; }