kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ale...@apache.org
Subject [1/2] kudu git commit: raft_consensus-itest: address flakiness in config-change tests
Date Sun, 09 Oct 2016 21:07:15 GMT
Repository: kudu
Updated Branches:
  refs/heads/master 833abea78 -> ac519fde8


raft_consensus-itest: address flakiness in config-change tests

Several tests were waiting until all replicas had set their
LAST_RECEIVED operation to '1' and assuming that a config change could
then proceed. However, even if all servers have received index 1, this
doesn't necessarily mean that the leader has received the corresponding
acknowledgement, and thus the leader may refuse the config change.

Change-Id: I3eed4ca551a3342dcb07330c43ef94e169db7ab8
Reviewed-on: http://gerrit.cloudera.org:8080/4637
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/5233e498
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/5233e498
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/5233e498

Branch: refs/heads/master
Commit: 5233e498b3ad79bf5f5b8f51af23b1838777d72d
Parents: 833abea
Author: Todd Lipcon <todd@apache.org>
Authored: Wed Oct 5 15:33:34 2016 -0700
Committer: Todd Lipcon <todd@apache.org>
Committed: Fri Oct 7 23:09:43 2016 +0000

----------------------------------------------------------------------
 src/kudu/integration-tests/raft_consensus-itest.cc | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/5233e498/src/kudu/integration-tests/raft_consensus-itest.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/raft_consensus-itest.cc b/src/kudu/integration-tests/raft_consensus-itest.cc
index 3b44243..99b110b 100644
--- a/src/kudu/integration-tests/raft_consensus-itest.cc
+++ b/src/kudu/integration-tests/raft_consensus-itest.cc
@@ -1546,7 +1546,7 @@ TEST_F(RaftConsensusITest, TestAddRemoveServer) {
   TServerDetails* leader_tserver = tservers[0];
   const string& leader_uuid = tservers[0]->uuid();
   ASSERT_OK(StartElection(leader_tserver, tablet_id_, kTimeout));
-  ASSERT_OK(WaitForServersToAgree(kTimeout, tablet_servers_, tablet_id_, 1));
+  ASSERT_OK(WaitUntilCommittedOpIdIndexIs(1, leader_tserver, tablet_id_, kTimeout));
 
   // Make sure the server rejects removal of itself from the configuration.
   Status s = RemoveServer(leader_tserver, tablet_id_, leader_tserver, boost::none, kTimeout);
@@ -1692,7 +1692,8 @@ TEST_F(RaftConsensusITest, TestAtomicAddRemoveServer) {
   // Elect server 0 as leader and wait for log index 1 to propagate to all servers.
   TServerDetails* leader_tserver = tservers[0];
   ASSERT_OK(StartElection(leader_tserver, tablet_id_, MonoDelta::FromSeconds(10)));
-  ASSERT_OK(WaitForServersToAgree(MonoDelta::FromSeconds(10), tablet_servers_, tablet_id_,
1));
+  ASSERT_OK(WaitUntilCommittedOpIdIndexIs(1, leader_tserver, tablet_id_,
+                                          MonoDelta::FromSeconds(10)));
   int64_t cur_log_index = 1;
 
   TabletServerMap active_tablet_servers = tablet_servers_;
@@ -1776,7 +1777,8 @@ TEST_F(RaftConsensusITest, TestElectPendingVoter) {
   // Elect server 0 as leader and wait for log index 1 to propagate to all servers.
   TServerDetails* initial_leader = tservers[0];
   ASSERT_OK(StartElection(initial_leader, tablet_id_, MonoDelta::FromSeconds(10)));
-  ASSERT_OK(WaitForServersToAgree(MonoDelta::FromSeconds(10), tablet_servers_, tablet_id_,
1));
+  ASSERT_OK(WaitUntilCommittedOpIdIndexIs(1, initial_leader, tablet_id_,
+                                          MonoDelta::FromSeconds(10)));
 
   // The server we will remove and then bring back.
   TServerDetails* final_leader = tservers[4];


Mime
View raw message