Alexey Serbin has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/8709 )

Change subject: KUDU-2230: the leader is always a viable voter
......................................................................


Patch Set 5:

(3 comments)

http://gerrit.cloudera.org:8080/#/c/8709/5/src/kudu/consensus/consensus_queue.cc
File src/kudu/consensus/consensus_queue.cc:

http://gerrit.cloudera.org:8080/#/c/8709/5/src/kudu/consensus/consensus_queue.cc@428
PS5, Line 428:     // Only consider a peer to be a viable voter if...
             :     // ...its last exchange was successful
             :     viable &= peer->last_exchange_status == PeerStatus::OK;
             :
             :     // ...the peer is up to date with the latest majority.
             :     //
             :     //    This indicates that it's actively participating in 
majorities and likely to
             :     //    replicate a config change immediately when we propose 
it.
             :     viable &= peer->last_received.index() >= 
queue_state_.majority_replicated_index;
             :
             :     // ...we have communicated successfully with it recently.
             :     //
             :     //    This handles the case where the tablet has had no 
recent writes and therefore
             :     //    even a replica that is down would have participated in 
the latest majority.
             :     auto unreachable_time = now - peer->last_communication_time;
             :     viable &= unreachable_time.ToMilliseconds() < 
FLAGS_consensus_rpc_timeout_ms;
> perhaps just wrap this part in the if-statement? i.e.
This contradicts a bit with the 'prefer short-circuiting the control flow' 
rule, but if you think that brings more clarity, then I'll update this.


http://gerrit.cloudera.org:8080/#/c/8709/5/src/kudu/integration-tests/tablet_replacement-itest.cc
File src/kudu/integration-tests/tablet_replacement-itest.cc:

http://gerrit.cloudera.org:8080/#/c/8709/5/src/kudu/integration-tests/tablet_replacement-itest.cc@337
PS5, Line 337:     Substitute("--consensus_rpc_timeout_ms=$0", 
kTimeout.ToMilliseconds()),
> can we shorten consensus_rpc_timeout_ms to maybe 3 seconds or 5 seconds?
Maybe -- my concern was that this test might become flaky in that case.  Let me 
try that and run many iterations with dist-test.


http://gerrit.cloudera.org:8080/#/c/8709/5/src/kudu/integration-tests/tablet_replacement-itest.cc@399
PS5, Line 399:   SleepFor(kTimeout);
> is it really necessary to sleep for 15 seconds in this test?
well, at this point it's enough to sleep  for (rpc_timeout - (2 * 
kUnavaliable)).  I just put kTimeout for clarity.  I'll update this to sleep 
less.



--
To view, visit http://gerrit.cloudera.org:8080/8709
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id200ec8e562e2b21c8eef09e7b38a8d85d23239c
Gerrit-Change-Number: 8709
Gerrit-PatchSet: 5
Gerrit-Owner: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Andrew Wong <[email protected]>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <[email protected]>
Gerrit-Comment-Date: Fri, 01 Dec 2017 18:50:25 +0000
Gerrit-HasComments: Yes

Reply via email to