Adar Dembo has submitted this change and it was merged. 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 Reviewed-on: http://gerrit.cloudera.org:8080/2714 Tested-by: Kudu Jenkins Reviewed-by: Todd Lipcon <[email protected]> --- M src/kudu/master/catalog_manager.cc M src/kudu/master/catalog_manager.h M src/kudu/master/master-test.cc 3 files changed, 103 insertions(+), 66 deletions(-) Approvals: Todd Lipcon: Looks good to me, approved Kudu Jenkins: Verified -- To view, visit http://gerrit.cloudera.org:8080/2714 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib9e11037e7f8b4c34db5e0f2b5be00f806532365 Gerrit-PatchSet: 5 Gerrit-Project: kudu Gerrit-Branch: master Gerrit-Owner: Adar Dembo <[email protected]> Gerrit-Reviewer: Adar Dembo <[email protected]> Gerrit-Reviewer: David Ribeiro Alves <[email protected]> Gerrit-Reviewer: Kudu Jenkins Gerrit-Reviewer: Todd Lipcon <[email protected]>
