kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From granthe...@apache.org
Subject [1/3] kudu git commit: Revert "KUDU-2364 Add extra check in ksck for tserver ID"
Date Wed, 02 May 2018 21:12:21 GMT
Repository: kudu
Updated Branches:
  refs/heads/branch-1.7.x e515667c8 -> ffc01ab72


Revert "KUDU-2364 Add extra check in ksck for tserver ID"

This reverts commit 45b3f2105bd04622b4d66109180ce53f1bea02d1.

Change-Id: I49d05616b37707237304b0ea55c197b850d17d2b
Reviewed-on: http://gerrit.cloudera.org:8080/10283
Reviewed-by: Andrew Wong <awong@cloudera.com>
Reviewed-by: Alexey Serbin <aserbin@cloudera.com>
Tested-by: Grant Henke <granthenke@apache.org>


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

Branch: refs/heads/branch-1.7.x
Commit: e49547837a3f3a945b573396cf6f28082dcad668
Parents: e515667
Author: Grant Henke <granthenke@apache.org>
Authored: Wed May 2 14:34:20 2018 -0500
Committer: Grant Henke <granthenke@apache.org>
Committed: Wed May 2 21:11:03 2018 +0000

----------------------------------------------------------------------
 src/kudu/tools/ksck-test.cc        | 21 -------------
 src/kudu/tools/ksck.cc             | 56 ---------------------------------
 src/kudu/tools/ksck.h              | 20 ------------
 src/kudu/tools/ksck_remote-test.cc | 27 ----------------
 src/kudu/tools/ksck_remote.cc      | 18 +++--------
 5 files changed, 4 insertions(+), 138 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/e4954783/src/kudu/tools/ksck-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tools/ksck-test.cc b/src/kudu/tools/ksck-test.cc
index 74157e7..a20febe 100644
--- a/src/kudu/tools/ksck-test.cc
+++ b/src/kudu/tools/ksck-test.cc
@@ -324,27 +324,6 @@ TEST_F(KsckTest, TestTabletServersOk) {
   ASSERT_OK(RunKsck());
 }
 
-TEST_F(KsckTest, TestWrongUUIDTabletServer) {
-  CreateOneTableOneTablet();
-
-  Status error = Status::RemoteError("ID reported by tablet server "
-                                     "doesn't match the expected ID");
-  static_pointer_cast<MockKsckTabletServer>(master_->tablet_servers_["ts-id-1"])
-    ->fetch_info_status_ = error;
-
-  ASSERT_OK(ksck_->CheckMasterRunning());
-  ASSERT_OK(ksck_->FetchTableAndTabletInfo());
-  ASSERT_TRUE(ksck_->FetchInfoFromTabletServers().IsNetworkError());
-  ASSERT_STR_CONTAINS(err_stream_.str(),
-    "Tablet Server Summary\n"
-    "  UUID   | RPC Address |      Status\n"
-    "---------+-------------+-------------------\n"
-    " ts-id-2 | <mock>      | HEALTHY\n"
-    " ts-id-0 | <mock>      | HEALTHY\n"
-    " ts-id-1 | <mock>      | WRONG_SERVER_UUID\n");
-}
-
-
 TEST_F(KsckTest, TestBadTabletServer) {
   CreateOneSmallReplicatedTable();
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/e4954783/src/kudu/tools/ksck.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tools/ksck.cc b/src/kudu/tools/ksck.cc
index 3a14f3e..df62828 100644
--- a/src/kudu/tools/ksck.cc
+++ b/src/kudu/tools/ksck.cc
@@ -26,7 +26,6 @@
 #include <mutex>
 #include <numeric>
 #include <type_traits>
-#include <vector>
 
 #include <boost/optional.hpp> // IWYU pragma: keep
 #include <gflags/gflags.h>
@@ -184,44 +183,16 @@ Status Ksck::FetchInfoFromTabletServers() {
 
   AtomicInt<int32_t> bad_servers(0);
   VLOG(1) << "Fetching info from all the Tablet Servers";
-
-  vector<TabletServerSummary> tablet_server_summaries;
-  simple_spinlock tablet_server_summaries_lock;
-
   for (const KsckMaster::TSMap::value_type& entry : cluster_->tablet_servers()) {
-
     CHECK_OK(pool->SubmitFunc([&]() {
           Status s = ConnectToTabletServer(entry.second);
-          TabletServerSummary summary;
           if (!s.ok()) {
             bad_servers.Increment();
-            if (s.IsRemoteError()) {
-              summary.health = TabletServerHealth::WRONG_SERVER_UUID;
-            } else {
-              summary.health = TabletServerHealth::UNAVAILABLE;
-            }
-          } else {
-            summary.health = TabletServerHealth::HEALTHY;
           }
-
-          summary.uuid = entry.second->uuid();
-          summary.host_port = entry.second->address();
-
-          std::lock_guard<simple_spinlock> lock(tablet_server_summaries_lock);
-          tablet_server_summaries.emplace_back(std::move(summary));
         }));
   }
-
   pool->Wait();
 
-  std::sort(tablet_server_summaries.begin(), tablet_server_summaries.end(),
-            [](const TabletServerSummary& left, const TabletServerSummary& right)
{
-              return std::make_pair(left.health != TabletServerHealth::HEALTHY, left.host_port)
<
-                     std::make_pair(right.health != TabletServerHealth::HEALTHY, right.host_port);
-            });
-
-  CHECK_OK(PrintTabletServerSummaries(tablet_server_summaries, Out()));
-
   if (bad_servers.Load() == 0) {
     Out() << Substitute("Fetched info from all $0 Tablet Servers", servers_count) <<
endl;
     return Status::OK();
@@ -250,33 +221,6 @@ Status Ksck::ConnectToTabletServer(const shared_ptr<KsckTabletServer>&
ts) {
   return s;
 }
 
-Status Ksck::PrintTabletServerSummaries(const vector<TabletServerSummary>& tablet_server_summaries,
-                                        ostream& out) {
-  out << "Tablet Server Summary" << endl;
-  DataTable table({ "UUID", "RPC Address", "Status"});
-
-  for (const auto& ts : tablet_server_summaries) {
-    string status;
-    switch (ts.health) {
-      case TabletServerHealth::HEALTHY:
-        status = "HEALTHY";
-        break;
-      case TabletServerHealth::UNAVAILABLE:
-        status = "UNAVAILABLE";
-        break;
-      case TabletServerHealth::WRONG_SERVER_UUID:
-        status = "WRONG_SERVER_UUID";
-        break;
-      default:
-        LOG(FATAL) << "Unexpected health alert received";
-        break;
-    }
-    table.AddRow({ ts.uuid, ts.host_port, status });
-  }
-
-  return table.PrintTo(out);
-}
-
 Status Ksck::PrintTableSummaries(const vector<TableSummary>& table_summaries, ostream&
out) {
   out << "Table Summary" << endl;
   DataTable table({ "Name", "Status", "Total Tablets",

http://git-wip-us.apache.org/repos/asf/kudu/blob/e4954783/src/kudu/tools/ksck.h
----------------------------------------------------------------------
diff --git a/src/kudu/tools/ksck.h b/src/kudu/tools/ksck.h
index c55b758..bf00d50 100644
--- a/src/kudu/tools/ksck.h
+++ b/src/kudu/tools/ksck.h
@@ -477,23 +477,6 @@ class Ksck {
     CONSENSUS_MISMATCH,
   };
 
-  enum class TabletServerHealth {
-    // The tablet server is healthy
-    HEALTHY,
-
-    // The tablet server couldn't be connected to
-    UNAVAILABLE,
-
-    // The tablet server reported an unknown UUID
-    WRONG_SERVER_UUID,
-  };
-
-  struct TabletServerSummary {
-    std::string uuid;
-    std::string host_port;
-    TabletServerHealth health;
-  };
-
   // Summarizes the result of VerifyTable().
   struct TableSummary {
     std::string name;
@@ -527,9 +510,6 @@ class Ksck {
     }
   };
 
-  static Status PrintTabletServerSummaries(
-    const std::vector<TabletServerSummary>& tablet_server_summaries,
-    std::ostream& out);
   static Status PrintTableSummaries(const std::vector<TableSummary>& table_summaries,
                                     std::ostream& out);
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/e4954783/src/kudu/tools/ksck_remote-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tools/ksck_remote-test.cc b/src/kudu/tools/ksck_remote-test.cc
index 370d0e2..2f64c38 100644
--- a/src/kudu/tools/ksck_remote-test.cc
+++ b/src/kudu/tools/ksck_remote-test.cc
@@ -34,17 +34,14 @@
 #include "kudu/gutil/gscoped_ptr.h"
 #include "kudu/gutil/port.h"
 #include "kudu/gutil/ref_counted.h"
-#include "kudu/gutil/strings/substitute.h"
 #include "kudu/master/mini_master.h"
 #include "kudu/mini-cluster/internal_mini_cluster.h"
 #include "kudu/tools/data_gen_util.h"
 #include "kudu/tools/ksck.h"
 #include "kudu/tools/ksck_remote.h"
-#include "kudu/tserver/mini_tablet_server.h"
 #include "kudu/util/atomic.h"
 #include "kudu/util/countdown_latch.h"
 #include "kudu/util/monotime.h"
-#include "kudu/util/net/net_util.h"
 #include "kudu/util/promise.h"
 #include "kudu/util/random.h"
 #include "kudu/util/status.h"
@@ -225,30 +222,6 @@ TEST_F(RemoteKsckTest, TestTabletServersOk) {
   ASSERT_OK(ksck_->FetchInfoFromTabletServers());
 }
 
-TEST_F(RemoteKsckTest, TestTabletServerMismatchUUID) {
-  ASSERT_OK(ksck_->CheckMasterRunning());
-  ASSERT_OK(ksck_->FetchTableAndTabletInfo());
-
-  tserver::MiniTabletServer* tablet_server = mini_cluster_->mini_tablet_server(0);
-  string old_uuid = tablet_server->uuid();
-  string root_dir = mini_cluster_->GetTabletServerFsRoot(0) + "2";
-  HostPort address = HostPort(tablet_server->bound_rpc_addr());
-
-  tablet_server->Shutdown();
-  tserver::MiniTabletServer new_tablet_server(root_dir, address);
-  ASSERT_OK(new_tablet_server.Start());
-  ASSERT_OK(new_tablet_server.WaitStarted());
-
-  string new_uuid = new_tablet_server.uuid();
-
-  ASSERT_TRUE(ksck_->FetchInfoFromTabletServers().IsNetworkError());
-
-  string match_string = "Remote error: ID reported by tablet server "
-                        "($0) doesn't match the expected ID: $1";
-
-  ASSERT_STR_CONTAINS(err_stream_.str(), strings::Substitute(match_string, new_uuid, old_uuid));
-}
-
 TEST_F(RemoteKsckTest, TestTableConsistency) {
   MonoTime deadline = MonoTime::Now() + MonoDelta::FromSeconds(30);
   Status s;

http://git-wip-us.apache.org/repos/asf/kudu/blob/e4954783/src/kudu/tools/ksck_remote.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tools/ksck_remote.cc b/src/kudu/tools/ksck_remote.cc
index d571809..27929ef 100644
--- a/src/kudu/tools/ksck_remote.cc
+++ b/src/kudu/tools/ksck_remote.cc
@@ -33,7 +33,6 @@
 #include "kudu/common/common.pb.h"
 #include "kudu/common/schema.h"
 #include "kudu/common/wire_protocol.h"
-#include "kudu/common/wire_protocol.pb.h"
 #include "kudu/consensus/consensus.pb.h"
 #include "kudu/consensus/consensus.proxy.h"
 #include "kudu/gutil/basictypes.h"
@@ -100,18 +99,12 @@ Status RemoteKsckTabletServer::FetchInfo() {
   state_ = kFetchFailed;
 
   {
-    server::GetStatusRequestPB req;
-    server::GetStatusResponsePB resp;
+    tserver::PingRequestPB req;
+    tserver::PingResponsePB resp;
     RpcController rpc;
     rpc.set_timeout(GetDefaultTimeout());
-    RETURN_NOT_OK_PREPEND(generic_proxy_->GetStatus(req, &resp, &rpc),
-                          "could not get status from server");
-    string response_uuid = resp.status().node_instance().permanent_uuid();
-    if (response_uuid != uuid()) {
-      return Status::RemoteError(Substitute("ID reported by tablet server ($0) doesn't "
-                                 "match the expected ID: $1",
-                                 response_uuid, uuid()));
-    }
+    RETURN_NOT_OK_PREPEND(ts_proxy_->Ping(req, &resp, &rpc),
+                          "could not send Ping RPC to server");
   }
 
   {
@@ -122,9 +115,6 @@ Status RemoteKsckTabletServer::FetchInfo() {
     req.set_need_schema_info(false);
     RETURN_NOT_OK_PREPEND(ts_proxy_->ListTablets(req, &resp, &rpc),
                           "could not list tablets");
-    if (resp.has_error()) {
-      return StatusFromPB(resp.error().status());
-    }
     tablet_status_map_.clear();
     for (auto& status : *resp.mutable_status_and_schema()) {
       tablet_status_map_[status.tablet_status().tablet_id()].Swap(status.mutable_tablet_status());


Mime
View raw message