You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by al...@apache.org on 2020/04/02 14:31:38 UTC

[kudu] branch master updated: [ksck] fix conflicting_states in VerifyTablet

This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
     new f155ae4  [ksck] fix conflicting_states in VerifyTablet
f155ae4 is described below

commit f155ae4732b06064b37871fca7fa30b645145f0c
Author: zhangyifan27 <ch...@163.com>
AuthorDate: Thu Apr 2 18:55:30 2020 +0800

    [ksck] fix conflicting_states in VerifyTablet
    
    The value of conflicting_states is calculated repeatedly,
    this patch fixes it.
    
    Change-Id: Ia8475ee34cd7957c3c02159dd2099c1179f1ea12
    Reviewed-on: http://gerrit.cloudera.org:8080/15637
    Reviewed-by: Alexey Serbin <as...@cloudera.com>
    Tested-by: Alexey Serbin <as...@cloudera.com>
---
 src/kudu/tools/ksck-test.cc |  2 +-
 src/kudu/tools/ksck.cc      | 10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/kudu/tools/ksck-test.cc b/src/kudu/tools/ksck-test.cc
index fe03d80..5e9ffd0 100644
--- a/src/kudu/tools/ksck-test.cc
+++ b/src/kudu/tools/ksck-test.cc
@@ -1470,7 +1470,7 @@ TEST_F(KsckTest, TestConsensusConflictExtraPeer) {
             error_messages[0].ToString());
   const string err_str = err_stream_.str();
   ASSERT_STR_CONTAINS(err_str, "Tablet tablet-id-0 of table 'test' is conflicted: "
-                               "3 replicas' active configs disagree with the leader master's");
+                               "1 replicas' active configs disagree with the leader master's");
   ASSERT_STR_CONTAINS(err_str,
       "The consensus matrix is:\n"
       " Config source |     Replicas     | Current term | Config index | Committed?\n"
diff --git a/src/kudu/tools/ksck.cc b/src/kudu/tools/ksck.cc
index 971deb1..57c38c6 100644
--- a/src/kudu/tools/ksck.cc
+++ b/src/kudu/tools/ksck.cc
@@ -938,11 +938,11 @@ HealthCheckResult Ksck::VerifyTablet(const shared_ptr<KsckTablet>& tablet,
                repl_info->status_pb->tablet_data_state() == tablet::TABLET_DATA_COPYING) {
       copying_replicas_count++;
     }
-    // Compare the master's and peers' consensus configs.
-    for (const auto& r : replicas) {
-      if (r.consensus_state && !r.consensus_state->Matches(master_config)) {
-        conflicting_states++;
-      }
+  }
+  // Compare the master's and peers' consensus configs.
+  for (const auto& r : replicas) {
+    if (r.consensus_state && !r.consensus_state->Matches(master_config)) {
+      conflicting_states++;
     }
   }