Mike Percy has posted comments on this change. Change subject: consensus: Get rid of LockFor*() methods ......................................................................
Patch Set 10: (11 comments) http://gerrit.cloudera.org:8080/#/c/7012/8/src/kudu/consensus/raft_consensus.cc File src/kudu/consensus/raft_consensus.cc: PS8, Line 718: wers is disabled. Doing nothing."; > this message could be updated now Done Line 1435: > seems like everywhere you take the lock, you are using AssertWaitAllowed. I would rather do that in a follow-up patch since this patch is only intended to move code around without changing functionality. Right now we use a spinlock, not a mutex. http://gerrit.cloudera.org:8080/#/c/7012/10/src/kudu/consensus/raft_consensus.cc File src/kudu/consensus/raft_consensus.cc: PS10, Line 284: << "Replica is not in kInitialized state: " > nit: I would drop this part since it does not make the message more actiona Done PS10, Line 313: } : : { : ThreadRestrictions::AssertWaitAllowed(); : LockGuard l(lock_); > It seems this could be safely removed. I would rather do that in a follow-up patch since this patch is not intended to change any functionality. PS10, Line 1360: SnoozeFailureDetectorUnlocked() > What if it returns non-OK status? Should that case be handled somehow? Nice catch, done. PS10, Line 2120: UniqueLock > why not LockGuard? We need to unlock() below at L2178 Line 2178: lock.unlock(); We unlock here. PS10, Line 2424: RETURN_NOT_OK(CheckActiveLeaderUnlocked()); : return Status::OK(); > nit: this could be reduced to Done http://gerrit.cloudera.org:8080/#/c/7012/8/src/kudu/consensus/raft_consensus.h File src/kudu/consensus/raft_consensus.h: PS8, Line 479: > this should probably also have WARN_UNUSED_RESULT Done http://gerrit.cloudera.org:8080/#/c/7012/10/src/kudu/consensus/raft_consensus.h File src/kudu/consensus/raft_consensus.h: PS10, Line 225: using UniqueLock = std::unique_lock<simple_spinlock>; > I found only one place which uses the UniqueLock in the .cc file, and I'm n see my reply on the other comment PS10, Line 469: operation > message? I like the terminology of Operation better, since we are replicating things like Write operations. See OperationType in consensus.proto -- To view, visit http://gerrit.cloudera.org:8080/7012 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6858752f4fbeb70b09eb4375c52e4aeaa1bb8e71 Gerrit-PatchSet: 10 Gerrit-Project: kudu Gerrit-Branch: master Gerrit-Owner: Mike Percy <mpe...@apache.org> Gerrit-Reviewer: Alexey Serbin <aser...@cloudera.com> Gerrit-Reviewer: David Ribeiro Alves <davidral...@gmail.com> Gerrit-Reviewer: Kudu Jenkins Gerrit-Reviewer: Mike Percy <mpe...@apache.org> Gerrit-Reviewer: Todd Lipcon <t...@apache.org> Gerrit-HasComments: Yes