You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by to...@apache.org on 2016/05/04 01:11:42 UTC

incubator-kudu git commit: KUDU-1433: check stat validity before dumping mm ops

Repository: incubator-kudu
Updated Branches:
  refs/heads/master d3eb2d8f4 -> 2b86e94d9


KUDU-1433: check stat validity before dumping mm ops

Some mm ops don't cache their stats, and in doing so, can yield invalid
stats following a call to FindBestOp(). Users of these stats need to be
aware that they may be invalid, and to protect themselves accordingly. In
this particular case, I think it makes more sense to provide zeroed stats
than to skip the op altogether.

After modifying the PeriodicWebUIChecker to access /maintenance-manager,
linked_list-test failed 100% of the time. With the fix, it doesn't fail.

Change-Id: I4c363c8b1adb9724a2c1deb09a27a7d89d84c270
Reviewed-on: http://gerrit.cloudera.org:8080/2922
Tested-by: Kudu Jenkins
Reviewed-by: Todd Lipcon <to...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/incubator-kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kudu/commit/2b86e94d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kudu/tree/2b86e94d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kudu/diff/2b86e94d

Branch: refs/heads/master
Commit: 2b86e94d992468e6ee92733662af5fc959da57e3
Parents: d3eb2d8
Author: Adar Dembo <ad...@cloudera.com>
Authored: Mon May 2 14:11:52 2016 +0200
Committer: Todd Lipcon <to...@apache.org>
Committed: Tue May 3 23:11:26 2016 +0000

----------------------------------------------------------------------
 src/kudu/integration-tests/linked_list-test-util.h |  1 +
 src/kudu/tablet/maintenance_manager.cc             | 15 +++++++++++----
 2 files changed, 12 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/2b86e94d/src/kudu/integration-tests/linked_list-test-util.h
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/linked_list-test-util.h b/src/kudu/integration-tests/linked_list-test-util.h
index 0364d9c..372a0bf 100644
--- a/src/kudu/integration-tests/linked_list-test-util.h
+++ b/src/kudu/integration-tests/linked_list-test-util.h
@@ -294,6 +294,7 @@ class PeriodicWebUIChecker {
     ts_pages.push_back("/metrics");
     ts_pages.push_back("/tablets");
     ts_pages.push_back(strings::Substitute("/transactions?tablet_id=$0", tablet_id));
+    ts_pages.push_back("/maintenance-manager");
 
     // Generate list of urls for each master and tablet server
     for (int i = 0; i < cluster.num_masters(); i++) {

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/2b86e94d/src/kudu/tablet/maintenance_manager.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/maintenance_manager.cc b/src/kudu/tablet/maintenance_manager.cc
index 14877bc..780d917 100644
--- a/src/kudu/tablet/maintenance_manager.cc
+++ b/src/kudu/tablet/maintenance_manager.cc
@@ -387,10 +387,17 @@ void MaintenanceManager::GetMaintenanceManagerStatusDump(MaintenanceManagerStatu
     MaintenanceOpStats& stat(val.second);
     op_pb->set_name(op->name());
     op_pb->set_running(op->running());
-    op_pb->set_runnable(stat.runnable());
-    op_pb->set_ram_anchored_bytes(stat.ram_anchored());
-    op_pb->set_logs_retained_bytes(stat.logs_retained_bytes());
-    op_pb->set_perf_improvement(stat.perf_improvement());
+    if (stat.valid()) {
+      op_pb->set_runnable(stat.runnable());
+      op_pb->set_ram_anchored_bytes(stat.ram_anchored());
+      op_pb->set_logs_retained_bytes(stat.logs_retained_bytes());
+      op_pb->set_perf_improvement(stat.perf_improvement());
+    } else {
+      op_pb->set_runnable(false);
+      op_pb->set_ram_anchored_bytes(0);
+      op_pb->set_logs_retained_bytes(0);
+      op_pb->set_perf_improvement(0.0);
+    }
 
     if (best_op == op) {
       out_pb->mutable_best_op()->CopyFrom(*op_pb);