kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [kudu] 01/02: KUDU-2763: Eliminate confusing log message
Date Wed, 15 May 2019 10:11:52 GMT
This is an automated email from the ASF dual-hosted git repository.

adar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git

commit 39a598741f008fbc3cba830e2644160ce799ac7e
Author: Mitch Barnett <mbarnett@cloudera.com>
AuthorDate: Mon May 13 18:03:46 2019 -0500

    KUDU-2763: Eliminate confusing log message
    
    Whenever a new tablet is created, the first leader will always send its
    first message with "preceding opid" set to (1,1). This generates a "log
    matching property violated" message that can confuse operators, when the
    behavior seen is actually what we expect. I wrapped the log output in a
    conditional statement so that we don't output the "log matching property
    violated" INFO message when the preceding_opid from the leader is equal to
    (1,1) which indicates a new tablet replica, thus the message doesn't need
    to be shown for this particular scenario.
    
    Change-Id: I95dd73cb2876dc3def218d84316ca015ddc9f166
    Reviewed-on: http://gerrit.cloudera.org:8080/13325
    Tested-by: Kudu Jenkins
    Reviewed-by: Andrew Wong <awong@cloudera.com>
---
 src/kudu/consensus/raft_consensus.cc | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/kudu/consensus/raft_consensus.cc b/src/kudu/consensus/raft_consensus.cc
index 3435d5d..a7b2057 100644
--- a/src/kudu/consensus/raft_consensus.cc
+++ b/src/kudu/consensus/raft_consensus.cc
@@ -1178,8 +1178,12 @@ Status RaftConsensus::EnforceLogMatchingPropertyMatchesUnlocked(const
LeaderRequ
                              ConsensusErrorPB::PRECEDING_ENTRY_DIDNT_MATCH,
                              Status::IllegalState(error_msg));
 
-  LOG_WITH_PREFIX_UNLOCKED(INFO) << "Refusing update from remote peer "
-                        << req.leader_uuid << ": " << error_msg;
+  // Adding a check to eliminate an unnecessary log message in the
+  // scenario where this is the first message from the Leader of a new tablet.
+  if (!OpIdEquals(MakeOpId(1,1), *req.preceding_opid)) {
+    LOG_WITH_PREFIX_UNLOCKED(INFO) << "Refusing update from remote peer "
+                                   << req.leader_uuid << ": " << error_msg;
+  }
 
   // If the terms mismatch we abort down to the index before the leader's preceding,
   // since we know that is the last opid that has a chance of not being overwritten.


Mime
View raw message