kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ale...@apache.org
Subject [kudu] branch master updated: KUDU-3006: deflake RebalanceIgnoredTserversTest.Basic
Date Sun, 01 Dec 2019 01:52:02 GMT
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 5dbfe8e  KUDU-3006: deflake RebalanceIgnoredTserversTest.Basic
5dbfe8e is described below

commit 5dbfe8ea182e87418095123782a262863be92dc6
Author: zhangyifan27 <chinazhangyifan@163.com>
AuthorDate: Thu Nov 28 23:06:47 2019 +0800

    KUDU-3006: deflake RebalanceIgnoredTserversTest.Basic
    
    It takes some time for the newly created replicas to bootstrap
    and get their status reported as 'healthy' in the catalog manager,
    if running the rebalancing prior to that, some unhealthy replicas
    would not be moved and the test would fail. So we should wait for
    the cluster become healthy and then run the rebalancing.
    
    Change-Id: Icf4b248a5fc91dac0dd6303da08f3b304878bfa2
    Reviewed-on: http://gerrit.cloudera.org:8080/14784
    Tested-by: Kudu Jenkins
    Reviewed-by: Alexey Serbin <aserbin@cloudera.com>
---
 src/kudu/rebalance/placement_policy_util.cc |  8 ++++----
 src/kudu/tools/rebalancer_tool-test.cc      | 20 ++++++++++++++++++--
 src/kudu/tools/rebalancer_tool.cc           |  8 ++++----
 3 files changed, 26 insertions(+), 10 deletions(-)

diff --git a/src/kudu/rebalance/placement_policy_util.cc b/src/kudu/rebalance/placement_policy_util.cc
index 7423f99..0992c21 100644
--- a/src/kudu/rebalance/placement_policy_util.cc
+++ b/src/kudu/rebalance/placement_policy_util.cc
@@ -242,10 +242,10 @@ Status BuildTabletsPlacementInfo(
     // TODO(aserbin): process RF=1 tablets as necessary
     if (tablet_summary.result != cluster_summary::HealthCheckResult::HEALTHY &&
         tablet_summary.result != cluster_summary::HealthCheckResult::RECOVERING) {
-      VLOG(1) << Substitute("tablet $0: not considering replicas for movement "
-                            "since the tablet's status is '$1'",
-                            tablet_id,
-                            cluster_summary::HealthCheckResultToString(tablet_summary.result));
+      LOG(INFO) << Substitute("tablet $0: not considering replicas for movement "
+                              "since the tablet's status is '$1'",
+                              tablet_id,
+                              cluster_summary::HealthCheckResultToString(tablet_summary.result));
       continue;
     }
     EmplaceOrDie(&tablet_to_table_id, tablet_id, tablet_summary.table_id);
diff --git a/src/kudu/tools/rebalancer_tool-test.cc b/src/kudu/tools/rebalancer_tool-test.cc
index c81aad6..86dffc6 100644
--- a/src/kudu/tools/rebalancer_tool-test.cc
+++ b/src/kudu/tools/rebalancer_tool-test.cc
@@ -300,9 +300,25 @@ class RebalanceIgnoredTserversTest :
     public AdminCliTest {
 };
 TEST_F(RebalanceIgnoredTserversTest, Basic) {
+  if (!AllowSlowTests()) {
+    LOG(WARNING) << "test is skipped; set KUDU_ALLOW_SLOW_TESTS=1 to run";
+    return;
+  }
+
   FLAGS_num_tablet_servers = 5;
+  // Start a cluster with a single tablet.
   NO_FATALS(BuildAndStart());
 
+  // Pre-condition: all replicas on ignored tservers should be healthy or recovering.
+  // Here we just ensure the cluster is healthy.
+  ASSERT_EVENTUALLY([&]() {
+    ASSERT_TOOL_OK(
+      "cluster",
+      "ksck",
+      cluster_->master()->bound_rpc_addr().ToString()
+    );
+  });
+
   // Assign one ignored tserver and move_replicas_from_ignored_tservers=true
   // without setting it into maintenance mode.
   {
@@ -354,8 +370,8 @@ TEST_F(RebalanceIgnoredTserversTest, Basic) {
   }
 
   // Assign two ignored tservers, one of which is unhealthy,
-  // 'move_replicas_from_ignored_tservers=true' and
-  // 'output_replica_distribution_details' are both enabled.
+  // '-move_replicas_from_ignored_tservers' and
+  // '-output_replica_distribution_details' are both enabled.
   auto* ts = cluster_->tablet_server(1);
   ASSERT_NE(nullptr, ts);
   ts->Shutdown();
diff --git a/src/kudu/tools/rebalancer_tool.cc b/src/kudu/tools/rebalancer_tool.cc
index 3a8192c..142038c 100644
--- a/src/kudu/tools/rebalancer_tool.cc
+++ b/src/kudu/tools/rebalancer_tool.cc
@@ -1435,10 +1435,10 @@ Status RebalancerTool::IgnoredTserversRunner::GetReplaceMoves(
     }
     if (tablet_summary.result != cluster_summary::HealthCheckResult::HEALTHY &&
         tablet_summary.result != cluster_summary::HealthCheckResult::RECOVERING) {
-      VLOG(1) << Substitute("tablet $0: not considering replicas for movement "
-                            "since the tablet's status is '$1'",
-                            tablet_summary.id,
-                            cluster_summary::HealthCheckResultToString(tablet_summary.result));
+      LOG(INFO) << Substitute("tablet $0: not considering replicas for movement "
+                              "since the tablet's status is '$1'",
+                              tablet_summary.id,
+                              cluster_summary::HealthCheckResultToString(tablet_summary.result));
       continue;
     }
     TabletInfo tablet_info;


Mime
View raw message