You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kudu.apache.org by "Adar Dembo (Code Review)" <ge...@cloudera.org> on 2016/04/02 06:27:07 UTC

[kudu-CR] master: don't expose any CreateTable() state too early

Hello David Ribeiro Alves, Todd Lipcon,

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

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

to review the following change.

Change subject: master: don't expose any CreateTable() state too early
......................................................................

master: don't expose any CreateTable() state too early

This was originally addressed by auditing all catalog manager readers (see
commit f971971), but David pointed out that we could do a better job if we
tracked ongoing table creation independently. With that in mind, here's an
approach that fixes the problem in CreateTable(). It's not absolutely
necessary, but:
1. It is forgiving to readers who forget to check the state of the table.
2. It obviates the need for any abort logic should table creation fail.

The new test highlights the tradeoff inherent by not introducing a new lock
that is used by "losers" to wait on table creation: the operation can fail
in a not quite TABLE_ALREADY_PRESENT but not quite TABLE_NOT_FOUND way. I
chose to express this using a new combination of error and code rather than
introduce a new code altogether.

Change-Id: Ib9e11037e7f8b4c34db5e0f2b5be00f806532365
---
M src/kudu/master/catalog_manager.cc
M src/kudu/master/catalog_manager.h
M src/kudu/master/master-test.cc
3 files changed, 92 insertions(+), 65 deletions(-)


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib9e11037e7f8b4c34db5e0f2b5be00f806532365
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: David Ribeiro Alves <da...@cloudera.com>
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>