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/06/29 22:27:12 UTC

incubator-kudu git commit: KUDU-1490: Show software version of tablet servers

Repository: incubator-kudu
Updated Branches:
  refs/heads/master 133767185 -> 1b7abe081


KUDU-1490: Show software version of tablet servers

In the web UI, it could be helpful to know what version of the
software a tablet server is running. This commit addresses this
by adding a field to the initial registration heartbeat of a
tablet. The version is displayed in the Registration column of
the Tablet Servers page of the master web server.

See:
https://raw.githubusercontent.com/anjuwong/kudu/tserver-vers/tserver_vers_on_master_ui.png

Change-Id: I84b32608c9e12a47f422b5047591d4098d187478
Reviewed-on: http://gerrit.cloudera.org:8080/3535
Reviewed-by: Adar Dembo <ad...@cloudera.com>
Tested-by: Kudu Jenkins


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

Branch: refs/heads/master
Commit: 1b7abe081817b5f9af979407df105a08dd226521
Parents: 1337671
Author: Andrew Wong <an...@cloudera.com>
Authored: Wed Jun 29 12:40:06 2016 -0700
Committer: Todd Lipcon <to...@apache.org>
Committed: Wed Jun 29 22:12:28 2016 +0000

----------------------------------------------------------------------
 src/kudu/integration-tests/registration-test.cc | 5 +++++
 src/kudu/master/master.proto                    | 3 +--
 src/kudu/tserver/heartbeater.cc                 | 3 +++
 3 files changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/1b7abe08/src/kudu/integration-tests/registration-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/registration-test.cc b/src/kudu/integration-tests/registration-test.cc
index 0895990..b0a1497 100644
--- a/src/kudu/integration-tests/registration-test.cc
+++ b/src/kudu/integration-tests/registration-test.cc
@@ -36,6 +36,7 @@
 #include "kudu/util/faststring.h"
 #include "kudu/util/test_util.h"
 #include "kudu/util/stopwatch.h"
+#include "kudu/util/version_info.h"
 
 DECLARE_int32(heartbeat_interval_ms);
 
@@ -81,6 +82,10 @@ class RegistrationTest : public KuduTest {
     string expected_uuid =
       cluster_->mini_tablet_server(0)->server()->instance_pb().permanent_uuid();
     ASSERT_STR_CONTAINS(buf.ToString(), expected_uuid);
+
+    // Should check that the TS software version is included on the page.
+    // tserver version should be the same as returned by GetShortVersionString()
+    ASSERT_STR_CONTAINS(buf.ToString(), VersionInfo::GetShortVersionString());
   }
 
  protected:

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/1b7abe08/src/kudu/master/master.proto
----------------------------------------------------------------------
diff --git a/src/kudu/master/master.proto b/src/kudu/master/master.proto
index f575e2e..4289bda 100644
--- a/src/kudu/master/master.proto
+++ b/src/kudu/master/master.proto
@@ -181,8 +181,7 @@ message PingResponsePB {
 message TSRegistrationPB {
   repeated HostPortPB rpc_addresses = 1;
   repeated HostPortPB http_addresses = 2;
-
-  // TODO: add stuff like software version, etc.
+  optional string software_version = 3;
 }
 
 message ReportedTabletPB {

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/1b7abe08/src/kudu/tserver/heartbeater.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/heartbeater.cc b/src/kudu/tserver/heartbeater.cc
index d0783ce..b506f95 100644
--- a/src/kudu/tserver/heartbeater.cc
+++ b/src/kudu/tserver/heartbeater.cc
@@ -37,6 +37,7 @@
 #include "kudu/util/monotime.h"
 #include "kudu/util/net/net_util.h"
 #include "kudu/util/status.h"
+#include "kudu/util/version_info.h"
 
 DEFINE_int32(heartbeat_rpc_timeout_ms, 15000,
              "Timeout used for the TS->Master heartbeat RPCs.");
@@ -273,6 +274,8 @@ Status Heartbeater::Thread::SetupRegistration(master::TSRegistrationPB* reg) {
                         "Unable to get bound HTTP addresses");
   RETURN_NOT_OK_PREPEND(AddHostPortPBs(addrs, reg->mutable_http_addresses()),
                         "Failed to add HTTP addresses to registration");
+  reg->set_software_version(VersionInfo::GetShortVersionString());
+
   return Status::OK();
 }