Adar Dembo has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/14954 )

Change subject: [consensus] short-circuit response path for RequestVote()
......................................................................


Patch Set 3:

(4 comments)

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

http://gerrit.cloudera.org:8080/#/c/14954/3/src/kudu/consensus/raft_consensus.h@894
PS3, Line 894: reponsed
responded to


http://gerrit.cloudera.org:8080/#/c/14954/3/src/kudu/consensus/raft_consensus.h@921
PS3, Line 921:  this
             :   // field assigned only when 'lock_' is held.
That aspect of the field's use is tangential to its synchronization, right? 
Meaning, if for whatever reason we stopped holding lock_ when writing to this 
field, there wouldn't be any inconsistencies, right?

If that's the case, I'd reword the comment to explain that only the 
std::atomic<> wrapping is necessary for synchronization, and maybe not even 
mention the lock_ stuff at all.


http://gerrit.cloudera.org:8080/#/c/14954/3/src/kudu/consensus/raft_consensus.cc
File src/kudu/consensus/raft_consensus.cc:

http://gerrit.cloudera.org:8080/#/c/14954/3/src/kudu/consensus/raft_consensus.cc@198
PS3, Line 198:   DCHECK(std::atomic_is_lock_free(&withhold_votes_until_));
Seems like this could be asserted at compile-time instead. Or not at all; isn't 
it obvious from inspection that accesses to a std::atomic<int64_t> will always 
be atomic?


http://gerrit.cloudera.org:8080/#/c/14954/3/src/kudu/consensus/raft_consensus.cc@1671
PS3, Line 1671:     return RequestVoteRespondLeaderIsAlive(request, response);
Should we recheck this condition after acquiring lock_ too?



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I67efef72b74ce243ca060e89fcec6eb11e95e8e8
Gerrit-Change-Number: 14954
Gerrit-PatchSet: 3
Gerrit-Owner: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Adar Dembo <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Sun, 29 Dec 2019 18:35:43 +0000
Gerrit-HasComments: Yes

Reply via email to