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

Change subject: [consensus] LeaderElection cleanup
......................................................................


Patch Set 3:

(2 comments)

> (2 comments)
 >
 > IIUC, the has_responder_term() changes don't affect backwards
 > compatibility between an "old" peer and a "new" peer because for an
 > old peer (which doesn't condition calls to responder_term() on
 > has_responder_term()), a direct call to responder_term() will yield
 > the default value of 0, which will always be lower than the term
 > under election and thus will have no ill effect. Is that correct?

Yes, that's the safety guarantee from the standpoint of pure PB considerations: 
0 is the lowest possible term and it's also aligned with the initial assignment 
for the term in the constructor of the LeaderElection structure.

http://gerrit.cloudera.org:8080/#/c/14947/3/src/kudu/consensus/leader_election.h
File src/kudu/consensus/leader_election.h:

http://gerrit.cloudera.org:8080/#/c/14947/3/src/kudu/consensus/leader_election.h@18
PS3, Line 18: #pragma once
> I've seen this warning show up before but haven't been able to make sense o
I thought that was because one of the makefiles contained this header file as a 
source to compile, but it's not the case.   So, it's a mystery to me as well.


http://gerrit.cloudera.org:8080/#/c/14947/3/src/kudu/consensus/leader_election.h@109
PS3, Line 109:   const ElectionVote decision;
> Seems weird that this is 'decision' but the constructor argument is 'vote'.
That is a trick to get rid of warning of using non-initialized variable (if 
compiling with older GCC compilers).  I think I can rename it into 
'election_decision' for the parameter name.



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic3163ff5c7a628431a145c11133c54e26b7165cd
Gerrit-Change-Number: 14947
Gerrit-PatchSet: 3
Gerrit-Owner: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Adar Dembo <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Bankim Bhavsar <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Comment-Date: Mon, 30 Dec 2019 03:07:08 +0000
Gerrit-HasComments: Yes

Reply via email to