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 2022/03/09 20:39:23 UTC

[kudu] branch master updated: [tools] correct rebalancer's initial status message

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 9e952ad  [tools] correct rebalancer's initial status message
9e952ad is described below

commit 9e952ad9d87eefc9ef840cd3edbdd62dd9f0243e
Author: Alexey Serbin <al...@apache.org>
AuthorDate: Mon Mar 7 12:27:35 2022 -0800

    [tools] correct rebalancer's initial status message
    
    I noticed that the 'kudu cluster rebalance' tool was reporting that
    it had been '...running whole-cluster rebalancing...' even when running
    with a particular set of tables to rebalance, i.e. not a whole-cluster
    rebalancing by any means if there is more than one table in a cluster.
    
    This patch fixes the issue.
    
    Change-Id: Ic224a07f9ce9ed3ca9a447022f183b799a1bebee
    Reviewed-on: http://gerrit.cloudera.org:8080/18297
    Reviewed-by: Abhishek Chennaka <ac...@cloudera.com>
    Tested-by: Alexey Serbin <al...@apache.org>
    Reviewed-by: Andrew Wong <aw...@cloudera.com>
---
 src/kudu/tools/rebalancer_tool.cc | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/kudu/tools/rebalancer_tool.cc b/src/kudu/tools/rebalancer_tool.cc
index b69ca05..8c53b3e 100644
--- a/src/kudu/tools/rebalancer_tool.cc
+++ b/src/kudu/tools/rebalancer_tool.cc
@@ -39,6 +39,7 @@
 #include "kudu/gutil/basictypes.h"
 #include "kudu/gutil/map-util.h"
 #include "kudu/gutil/port.h"
+#include "kudu/gutil/strings/join.h"
 #include "kudu/gutil/strings/substitute.h"
 #include "kudu/master/master.pb.h"
 #include "kudu/rebalance/cluster_status.h"
@@ -190,7 +191,12 @@ Status RebalancerTool::Run(RunStatus* result_status, size_t* moves_count) {
   }
   if (ts_id_by_location.size() == 1) {
     const auto& location = ts_id_by_location.cbegin()->first;
-    LOG(INFO) << "running whole-cluster rebalancing";
+    const auto& table_filters = config_.table_filters;
+    const auto& msg = table_filters.empty()
+        ? "running whole-cluster rebalancing"
+        : Substitute("running rebalancing for tables: $0",
+                     JoinStrings(table_filters, ","));
+    LOG(INFO) << msg;
     IntraLocationRunner runner(
         this, config_.ignored_tservers, config_.max_moves_per_server, deadline, location);
     RETURN_NOT_OK(runner.Init(config_.master_addresses));