Todd Lipcon has submitted this change and it was merged.

Change subject: consensus: split ReplicaState in twain[1]
......................................................................


consensus: split ReplicaState in twain[1]

Following on the previous refactor, this splits out the parts of the
ReplicaState class that deal with pending consensus rounds into a new
PendingRounds class.

The change is mostly mechanical. The new class is made non-thread-safe
and we still use the synchronization of the ReplicaState class to
protect it. Since all of the methods dealing with pending rounds were
already 'Unlocked', this should be safe. The goal is to later make the
synchronization more fine-grained.

To that end, all of the methods were renamed to remove the 'Unlocked'
suffix.

There were several places in RaftConsensus which were using the
committed index/term tracked by PendingRounds, but it seems plausible
that these would be better tracked elsewhere. I left TODOs to deal with
this rather than making non-mechanical changes in this patch.

[1] https://www.youtube.com/watch?v=ZXRb6nPcx10

Change-Id: I95308ae8a5d65ada016ae08e0e8cf06c54b35909
Reviewed-on: http://gerrit.cloudera.org:8080/4713
Tested-by: Kudu Jenkins
Reviewed-by: Todd Lipcon <[email protected]>
---
M src/kudu/consensus/raft_consensus.cc
M src/kudu/consensus/raft_consensus.h
M src/kudu/consensus/raft_consensus_quorum-test.cc
M src/kudu/consensus/raft_consensus_state.cc
M src/kudu/consensus/raft_consensus_state.h
5 files changed, 293 insertions(+), 299 deletions(-)

Approvals:
  Todd Lipcon: Looks good to me, approved
  Kudu Jenkins: Verified



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

Gerrit-MessageType: merged
Gerrit-Change-Id: I95308ae8a5d65ada016ae08e0e8cf06c54b35909
Gerrit-PatchSet: 8
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <[email protected]>
Gerrit-Reviewer: David Ribeiro Alves <[email protected]>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <[email protected]>
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Todd Lipcon <[email protected]>

Reply via email to