Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/16034 )
Change subject: [consensus] KUDU-2727 lock-free CheckLeadershipAndBindTerm() ...................................................................... Patch Set 5: (3 comments) http://gerrit.cloudera.org:8080/#/c/16034/2/src/kudu/consensus/consensus_meta.cc File src/kudu/consensus/consensus_meta.cc: http://gerrit.cloudera.org:8080/#/c/16034/2/src/kudu/consensus/consensus_meta.cc@61 PS2, Line 61: constexpr size_t kPackedRoleBits = 3; > Worth adding an acsii diagram of how the role and term bits are packed incl Done http://gerrit.cloudera.org:8080/#/c/16034/2/src/kudu/consensus/consensus_meta.cc@75 PS2, Line 75: ^ > typo Done http://gerrit.cloudera.org:8080/#/c/16034/5/src/kudu/consensus/raft_consensus.cc File src/kudu/consensus/raft_consensus.cc: http://gerrit.cloudera.org:8080/#/c/16034/5/src/kudu/consensus/raft_consensus.cc@201 PS5, Line 201: LockGuard l(lock_); > Why is the lock needed now? It's not very likely that Init() will be called concurrently by multiple threads, however SetStateUnlocked() is called in this method. The name of the method implies the lock is held. Not holding the lock triggers DCHECK() assertion in SetStateUnlocked(). -- To view, visit http://gerrit.cloudera.org:8080/16034 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I934ae3035d893fd850afe27d96f8dd6612c9ffbd Gerrit-Change-Number: 16034 Gerrit-PatchSet: 5 Gerrit-Owner: Alexey Serbin <[email protected]> Gerrit-Reviewer: Alexey Serbin <[email protected]> Gerrit-Reviewer: Andrew Wong <[email protected]> Gerrit-Reviewer: Bankim Bhavsar <[email protected]> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Comment-Date: Fri, 19 Jun 2020 17:25:44 +0000 Gerrit-HasComments: Yes
