busbey commented on a change in pull request #3356:
URL: https://github.com/apache/hbase/pull/3356#discussion_r646624197



##########
File path: 
hbase-balancer/src/main/java/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.java
##########
@@ -343,15 +343,15 @@ boolean needsBalance(TableName tableName, 
BalancerClusterState cluster) {
       sendRejectionReasonToRingBuffer(() -> getBalanceReason(calculatedTotal, 
calculatedMultiplier),
         costFunctions);
     }
-    if (LOG.isDebugEnabled()) {
-      LOG.debug("{} {}; total cost={}, sum multiplier={}; cost/multiplier to 
need a balance is {}",
-          balanced ? "Skipping load balancing because balanced" : "We need to 
load balance",
-          isByTable ? String.format("table (%s)", tableName) : "cluster",
-          total, sumMultiplier, minCostNeedBalance);
-      if (LOG.isTraceEnabled()) {
-        LOG.trace("Balance decision detailed function costs={}", 
functionCost());
-      }
+    LOG.info("{} {}; total cost={}, sum multiplier={}; cost/multiplier to need 
a balance is {}",
+      balanced ? "Skipping load balancing because balanced" :
+        "Start calculating moving plan without logging info for up to {} secs",

Review comment:
       This is a potential value to fill into a parameter in the first string 
given to `LOG.info`, does having a parameter to expand in here work?
   
   maybe a comment on this PR with some examples of the log messages we end up 
with post-patch would help?

##########
File path: 
hbase-balancer/src/main/java/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.java
##########
@@ -343,15 +343,15 @@ boolean needsBalance(TableName tableName, 
BalancerClusterState cluster) {
       sendRejectionReasonToRingBuffer(() -> getBalanceReason(calculatedTotal, 
calculatedMultiplier),
         costFunctions);
     }
-    if (LOG.isDebugEnabled()) {
-      LOG.debug("{} {}; total cost={}, sum multiplier={}; cost/multiplier to 
need a balance is {}",
-          balanced ? "Skipping load balancing because balanced" : "We need to 
load balance",
-          isByTable ? String.format("table (%s)", tableName) : "cluster",
-          total, sumMultiplier, minCostNeedBalance);
-      if (LOG.isTraceEnabled()) {
-        LOG.trace("Balance decision detailed function costs={}", 
functionCost());
-      }
+    LOG.info("{} {}; total cost={}, sum multiplier={}; cost/multiplier to need 
a balance is {}",

Review comment:
       What's the rationale for moving this from debug logging to info logging?

##########
File path: 
hbase-balancer/src/main/java/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.java
##########
@@ -343,15 +343,15 @@ boolean needsBalance(TableName tableName, 
BalancerClusterState cluster) {
       sendRejectionReasonToRingBuffer(() -> getBalanceReason(calculatedTotal, 
calculatedMultiplier),
         costFunctions);
     }
-    if (LOG.isDebugEnabled()) {
-      LOG.debug("{} {}; total cost={}, sum multiplier={}; cost/multiplier to 
need a balance is {}",
-          balanced ? "Skipping load balancing because balanced" : "We need to 
load balance",
-          isByTable ? String.format("table (%s)", tableName) : "cluster",
-          total, sumMultiplier, minCostNeedBalance);
-      if (LOG.isTraceEnabled()) {
-        LOG.trace("Balance decision detailed function costs={}", 
functionCost());
-      }
+    LOG.info("{} {}; total cost={}, sum multiplier={}; cost/multiplier to need 
a balance is {}",
+      balanced ? "Skipping load balancing because balanced" :

Review comment:
       you mean beyond the given cost, multiplier, and needed threshold? you 
thinking of the individual cost functions?

##########
File path: 
hbase-balancer/src/main/java/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.java
##########
@@ -470,17 +470,17 @@ private long calculateMaxSteps(BalancerClusterState 
cluster) {
     updateStochasticCosts(tableName, curOverallCost, curFunctionCosts);
     if (initCost > currentCost) {
       List<RegionPlan> plans = createRegionPlans(cluster);
-      LOG.info("Finished computing new load balance plan. Computation took {}" 
+
-        " to try {} different iterations.  Found a solution that moves " +
-        "{} regions; Going from a computed cost of {}" +
-        " to a new cost of {}", java.time.Duration.ofMillis(endTime - 
startTime),
-        step, plans.size(), initCost, currentCost);
+      LOG.info("Finished computing new load balance plan. Computation took {} 
ms" +
+          " to try {} different iterations.  Found a solution that moves " +
+          "{} regions; Going from a computed cost of {}" +
+          " to a new cost of {}. Move plan to be submitted to master to 
execute",

Review comment:
       It's not accurate to say we're executing the plan at this point though.
   
   What ware we trying to convey with this addition? From the issue description 
I think it's that the act of selecting a plan for the cluster does not mean 
we've executed that plan. is that correct?

##########
File path: 
hbase-balancer/src/main/java/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.java
##########
@@ -343,15 +343,15 @@ boolean needsBalance(TableName tableName, 
BalancerClusterState cluster) {
       sendRejectionReasonToRingBuffer(() -> getBalanceReason(calculatedTotal, 
calculatedMultiplier),
         costFunctions);
     }
-    if (LOG.isDebugEnabled()) {
-      LOG.debug("{} {}; total cost={}, sum multiplier={}; cost/multiplier to 
need a balance is {}",
-          balanced ? "Skipping load balancing because balanced" : "We need to 
load balance",
-          isByTable ? String.format("table (%s)", tableName) : "cluster",
-          total, sumMultiplier, minCostNeedBalance);
-      if (LOG.isTraceEnabled()) {
-        LOG.trace("Balance decision detailed function costs={}", 
functionCost());
-      }
+    LOG.info("{} {}; total cost={}, sum multiplier={}; cost/multiplier to need 
a balance is {}",
+      balanced ? "Skipping load balancing because balanced" :
+        "Start calculating moving plan without logging info for up to {} secs",
+      isByTable ? String.format("table (%s)", tableName) : "cluster",
+      total, sumMultiplier, minCostNeedBalance, maxRunningTime / 1000);
+    if (LOG.isTraceEnabled()) {
+      LOG.trace("Balance decision detailed function costs={}", functionCost());
     }

Review comment:
       if the general status message of "I'm doing some balancing (or not)" is 
going to info level, should this detail of individual cost functions go to 
debug?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to