Hello David Ribeiro Alves, Todd Lipcon,

I'd like you to do a code review.  Please visit

    http://gerrit.cloudera.org:8080/6957

to review the following change.

Change subject: KUDU-871 (part 1). Refactor to make cmeta a first class object
......................................................................

KUDU-871 (part 1). Refactor to make cmeta a first class object

This patch is primarily a refactor to TabletReplica and RaftConsensus to
ensure that they are always constructed with a ConsensusMetadata object.
The ConsensusMetadata file is required for tombstoned voting as the
record of a replica's votes.

Changes in this patch:

1) Allow RaftConsensus to operate while not initialized or in a shutdown
   state. Also pass ConsensusMetadata into the RaftConsensus
   constructor.

2) Refactor TabletReplica to create a RaftConsensus instance at
   construction time. This will allow us to incorporate tombstoned
   voting later by allowing RaftConsensus to be accessible from a
   TabletReplica that comes up fresh in the TABLET_DATA_TOMBSTONED
   state. Also, do not destroy the Consensus object on
   TabletPeer::Shutdown() for the same reasons.

3) Add an additional on-disk data state (TABLET_DATA_FRESH) to allow us
   to identify when we crashed between writing the superblock and the
   ConsensusMetadata file. If a tablet is in that state then it has
   never voted so is legal to fully delete instead of attempt to recover
   at startup time.

Other changes:

* Remove unused Consensus::State enum.
* Get rid of TabletStatusListener
* bug fix: RaftConsensus must hold lock before snoozing FD

TODO:

* Add additional lifecycle runtime assertions in TabletReplica and
  RaftConsensus.
* Consider adding additional ReplicaState::State enum value for
  kInitialized but not kRunning.
* Finish writing new crash recovery tests.

Change-Id: Ia27a091d27b3996d37009d5ec866e744f9608388
---
M src/kudu/consensus/consensus.h
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/integration-tests/ts_recovery-itest.cc
M src/kudu/master/sys_catalog.cc
M src/kudu/master/sys_catalog.h
M src/kudu/tablet/metadata.proto
M src/kudu/tablet/tablet_bootstrap-test.cc
M src/kudu/tablet/tablet_bootstrap.cc
M src/kudu/tablet/tablet_bootstrap.h
M src/kudu/tablet/tablet_replica-test.cc
M src/kudu/tablet/tablet_replica.cc
M src/kudu/tablet/tablet_replica.h
M src/kudu/tserver/tablet_copy_client.cc
M src/kudu/tserver/tablet_copy_client.h
M src/kudu/tserver/tablet_copy_source_session-test.cc
M src/kudu/tserver/ts_tablet_manager.cc
M src/kudu/tserver/ts_tablet_manager.h
M src/kudu/tserver/tserver-path-handlers.cc
20 files changed, 411 insertions(+), 381 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/57/6957/1
-- 
To view, visit http://gerrit.cloudera.org:8080/6957
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia27a091d27b3996d37009d5ec866e744f9608388
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Mike Percy <[email protected]>
Gerrit-Reviewer: David Ribeiro Alves <[email protected]>
Gerrit-Reviewer: Todd Lipcon <[email protected]>

Reply via email to