You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "Mike Percy (Code Review)" <ge...@cloudera.org> on 2017/06/15 17:32:06 UTC

[kudu-CR] WIP: Ensure ConsensusMetadata exists, even for tombstoned tablets

Hello David Ribeiro Alves, Alexey Serbin, Kudu Jenkins,

I'd like you to reexamine a change.  Please visit

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

to look at the new patch set (#2).

Change subject: WIP: Ensure ConsensusMetadata exists, even for tombstoned tablets
......................................................................

WIP: Ensure ConsensusMetadata exists, even for tombstoned tablets

Adds a TABLET_DATA_FRESH data state and a NOT_INITIALIZED run state.

The ConsensusMetadata file is required for tombstoned voting as the
record of a replica's votes.

Changes:

1) 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.

2) Add an additional run state to TabletReplica (NOT_INITIALIZED) for
   lifecycle validation purposes.

3) Refactor TabletReplica to create a RaftConsensus instance at Init()
   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.

Tests:

* Adds a test for TABLET_DATA_FRESH crash recovery behavior at tablet
  creation time: TsRecoveryITest.TestCrashBeforeWritingConsensusMetadata
* Adds a tablet copy fault test as well:
  TabletCopyITest.TestTabletCopyFresh

TODO:

* TabletCopyITest.TestTabletCopyFresh is currently failing.

Change-Id: Ia27a091d27b3996d37009d5ec866e744f9608388
---
M src/kudu/integration-tests/tablet_copy-itest.cc
M src/kudu/integration-tests/ts_recovery-itest.cc
M src/kudu/master/sys_catalog.cc
M src/kudu/tablet/metadata.proto
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
12 files changed, 253 insertions(+), 52 deletions(-)


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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ia27a091d27b3996d37009d5ec866e744f9608388
Gerrit-PatchSet: 2
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: David Ribeiro Alves <da...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>