kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mpe...@apache.org
Subject [2/3] kudu git commit: client-test: remove an unnecessary manual leader election
Date Tue, 30 Aug 2016 06:25:35 GMT
client-test: remove an unnecessary manual leader election

One test case predates the addition of automatic leader election to
Kudu, and was manually triggering a leader election after killing a
node. This is no longer necessary, so the test can be simplified.

Change-Id: I943d331d4d8afed9d7d929df1df05aa2f3cf454e
Reviewed-on: http://gerrit.cloudera.org:8080/4141
Tested-by: Kudu Jenkins
Reviewed-by: Mike Percy <mpercy@apache.org>


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

Branch: refs/heads/master
Commit: 5e368488b10b28444e03517283beb8ecb958573d
Parents: f78d1c8
Author: Todd Lipcon <todd@apache.org>
Authored: Fri Aug 26 17:33:05 2016 -0700
Committer: Mike Percy <mpercy@apache.org>
Committed: Tue Aug 30 06:24:58 2016 +0000

----------------------------------------------------------------------
 src/kudu/client/client-test.cc | 40 -------------------------------------
 1 file changed, 40 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/5e368488/src/kudu/client/client-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/client/client-test.cc b/src/kudu/client/client-test.cc
index 26ba4c3..1af7c59 100644
--- a/src/kudu/client/client-test.cc
+++ b/src/kudu/client/client-test.cc
@@ -38,7 +38,6 @@
 #include "kudu/client/write_op.h"
 #include "kudu/common/partial_row.h"
 #include "kudu/common/wire_protocol.h"
-#include "kudu/consensus/consensus.proxy.h"
 #include "kudu/gutil/atomicops.h"
 #include "kudu/gutil/map-util.h"
 #include "kudu/gutil/stl_util.h"
@@ -2560,8 +2559,6 @@ TEST_F(ClientTest, TestReplicatedMultiTabletTableFailover) {
 // tablet dies.
 // This currently forces leader promotion through RPC and creates
 // a new client afterwards.
-// TODO Remove the leader promotion part when we have automated
-// leader election.
 TEST_F(ClientTest, TestReplicatedTabletWritesWithLeaderElection) {
   const string kReplicatedTable = "replicated_failover_on_writes";
   const int kNumRowsToWrite = 100;
@@ -2595,43 +2592,6 @@ TEST_F(ClientTest, TestReplicatedTabletWritesWithLeaderElection) {
   // Kill the tserver that is serving the leader tablet.
   ASSERT_OK(KillTServer(killed_uuid));
 
-  // Since we waited before, hopefully all replicas will be up to date
-  // and we can just promote another replica.
-  std::shared_ptr<rpc::Messenger> client_messenger;
-  rpc::MessengerBuilder bld("client");
-  ASSERT_OK(bld.Build(&client_messenger));
-  gscoped_ptr<consensus::ConsensusServiceProxy> new_leader_proxy;
-
-  int new_leader_idx = -1;
-  for (int i = 0; i < cluster_->num_tablet_servers(); i++) {
-    MiniTabletServer* ts = cluster_->mini_tablet_server(i);
-    if (ts->is_started()) {
-      const string& uuid = ts->server()->instance_pb().permanent_uuid();
-      if (uuid != killed_uuid) {
-        new_leader_idx = i;
-        break;
-      }
-    }
-  }
-  ASSERT_NE(-1, new_leader_idx);
-
-  MiniTabletServer* new_leader = cluster_->mini_tablet_server(new_leader_idx);
-  ASSERT_TRUE(new_leader != nullptr);
-  new_leader_proxy.reset(
-      new consensus::ConsensusServiceProxy(client_messenger,
-                                           new_leader->bound_rpc_addr()));
-
-  consensus::RunLeaderElectionRequestPB req;
-  consensus::RunLeaderElectionResponsePB resp;
-  rpc::RpcController controller;
-
-  LOG(INFO) << "Promoting server at index " << new_leader_idx << " listening
at "
-            << new_leader->bound_rpc_addr().ToString() << " ...";
-  req.set_dest_uuid(new_leader->server()->fs_manager()->uuid());
-  req.set_tablet_id(rt->tablet_id());
-  ASSERT_OK(new_leader_proxy->RunLeaderElection(req, &resp, &controller));
-  ASSERT_FALSE(resp.has_error()) << "Got error. Response: " << resp.ShortDebugString();
-
   LOG(INFO) << "Inserting additional rows...";
   ASSERT_NO_FATAL_FAILURE(InsertTestRows(client_.get(),
                                          table.get(),


Mime
View raw message