You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "Andrew Wong (Code Review)" <ge...@cloudera.org> on 2017/11/13 22:48:28 UTC

[kudu-CR] tablet: check for stopped in drivers of IO

Hello Tidy Bot, Alexey Serbin, Mike Percy, Kudu Jenkins, Adar Dembo, Todd Lipcon, 

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

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

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

Change subject: tablet: check for stopped in drivers of IO
......................................................................

tablet: check for stopped in drivers of IO

This patch adds the invariant that if a tablet function drives I/O, it
must first check that the tablet has not been stopped, and, before
returning, it must again check that the tablet has not been stopped.

E.g. Tablet::FlushUnlocked() is a function that drives IO and it is
drives the operation of flush MRSs. Thus, before doing anything, it must
check that the tablet has not been stopped, and before returning, it
must again check that the tablet has been stopped. The calling
maintenance manager thread must be able to handle errors returned in
this way.

For now, this is an optimization to allow tablet shutdown without
having to wait on maintenance ops. In the future, this can be used to
allow errors that leave in-memory state inconsistent to not crash,
provided they first stop the tablet. This would guarantee that nothing
can successfully return with inconsistent results.

In preparation for this, there are various fatal safety checks
surrounding such driving functions that are updated to simply return
errors. Their call-sites have been updated to check the state of the
tablet, ensuring these failures are safe.

This patch also refactors some void methods to return Statuses where
these checks may be possible, and vise versa when Statuses are not
needed.

Change-Id: I0241cd4206ce77ef1fb334458b091bc2092f4141
---
M src/kudu/tablet/delta_compaction.cc
M src/kudu/tablet/delta_compaction.h
M src/kudu/tablet/delta_tracker.cc
M src/kudu/tablet/delta_tracker.h
M src/kudu/tablet/diskrowset.cc
M src/kudu/tablet/diskrowset.h
M src/kudu/tablet/metadata-test.cc
M src/kudu/tablet/rowset_metadata.cc
M src/kudu/tablet/rowset_metadata.h
M src/kudu/tablet/tablet.cc
M src/kudu/tablet/tablet_mm_ops.cc
M src/kudu/tablet/tablet_replica_mm_ops.cc
12 files changed, 215 insertions(+), 179 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/41/8441/4
-- 
To view, visit http://gerrit.cloudera.org:8080/8441
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I0241cd4206ce77ef1fb334458b091bc2092f4141
Gerrit-Change-Number: 8441
Gerrit-PatchSet: 4
Gerrit-Owner: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>