kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject [2/3] incubator-kudu git commit: [consensus] Make some logs less spammy
Date Tue, 05 Jan 2016 18:53:14 GMT
[consensus] Make some logs less spammy

We're running some chaos monkey-like workloads and we're getting into
situations where we're able to generate hundreds of MBs of logs per
minute. This patch fixes two of such logs.

Change-Id: Ib41166786bfb1a35ebb7acb721a69cbc7ecc28a4
Reviewed-on: http://gerrit.cloudera.org:8080/1674
Tested-by: Jean-Daniel Cryans
Reviewed-by: Mike Percy <mpercy@cloudera.com>


Project: http://git-wip-us.apache.org/repos/asf/incubator-kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kudu/commit/c367baa6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kudu/tree/c367baa6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kudu/diff/c367baa6

Branch: refs/heads/master
Commit: c367baa61a7e1b6c69fbde1fd13be5885277c19b
Parents: 170c32c
Author: Jean-Daniel Cryans <jdcryans@cloudera.com>
Authored: Mon Dec 21 10:43:01 2015 -0800
Committer: Jean-Daniel Cryans <jdcryans@gerrit.cloudera.org>
Committed: Wed Dec 23 16:44:57 2015 +0000

----------------------------------------------------------------------
 src/kudu/consensus/raft_consensus.cc       | 9 +++++++--
 src/kudu/consensus/raft_consensus_state.cc | 3 ++-
 2 files changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/c367baa6/src/kudu/consensus/raft_consensus.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/raft_consensus.cc b/src/kudu/consensus/raft_consensus.cc
index e81b8e7..a675065 100644
--- a/src/kudu/consensus/raft_consensus.cc
+++ b/src/kudu/consensus/raft_consensus.cc
@@ -1107,11 +1107,16 @@ Status RaftConsensus::UpdateReplica(const ConsensusRequestPB* request,
     // that were actually prepared, and deleting the other ones since we've taken ownership
     // when we first deduped.
     if (iter != deduped_req.messages.end()) {
+      bool need_to_warn = true;
       while (iter != deduped_req.messages.end()) {
         ReplicateRefPtr msg = (*iter);
         iter = deduped_req.messages.erase(iter);
-        LOG_WITH_PREFIX_UNLOCKED(WARNING) << "Could not prepare transaction for op:
"
-            << msg->get()->id() << ". Status: " << prepare_status.ToString();
+        if (need_to_warn) {
+          need_to_warn = false;
+          LOG_WITH_PREFIX_UNLOCKED(WARNING) << "Could not prepare transaction for op:
"
+              << msg->get()->id() << ". Suppressed " << deduped_req.messages.size()
<<
+              " other warnings. Status for this op: " << prepare_status.ToString();
+        }
       }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/c367baa6/src/kudu/consensus/raft_consensus_state.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/raft_consensus_state.cc b/src/kudu/consensus/raft_consensus_state.cc
index 8495b5b..8127aec 100644
--- a/src/kudu/consensus/raft_consensus_state.cc
+++ b/src/kudu/consensus/raft_consensus_state.cc
@@ -523,7 +523,8 @@ Status ReplicaState::UpdateMajorityReplicatedUnlocked(const OpId&
majority_repli
   }
 
   committed_index->CopyFrom(last_committed_index_);
-  LOG_WITH_PREFIX_UNLOCKED(WARNING) << "Can't advance the committed index across term
boundaries"
+  KLOG_EVERY_N_SECS(WARNING, 1) << LogPrefixUnlocked()
+          << "Can't advance the committed index across term boundaries"
           << " until operations from the current term are replicated."
           << " Last committed operation was: " << last_committed_index_.ShortDebugString()
<< ","
           << " New majority replicated is: " << majority_replicated.ShortDebugString()
<< ","


Mime
View raw message