This is an automated email from the ASF dual-hosted git repository. alexey pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/kudu.git
commit 2286f51687f8b6c4cdf8386040008754f92c6d45 Author: Alexey Serbin <[email protected]> AuthorDate: Mon May 6 19:25:10 2019 -0700 [catalog_manager] run sanity checks before catching up with HMS When serving CreateTable request, run basic validation and authz-related checks before waiting for HMS notification listener to catch up. That's to fail fast if the incoming request doesn't pass basic sanity verification or isn't authorized. Change-Id: Ia407554fcd703d424180218f12f23556f54eefeb Reviewed-on: http://gerrit.cloudera.org:8080/13257 Reviewed-by: Adar Dembo <[email protected]> Tested-by: Alexey Serbin <[email protected]> --- src/kudu/master/catalog_manager.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/kudu/master/catalog_manager.cc b/src/kudu/master/catalog_manager.cc index 88d0d16..b933ad5 100644 --- a/src/kudu/master/catalog_manager.cc +++ b/src/kudu/master/catalog_manager.cc @@ -1404,12 +1404,6 @@ Status CatalogManager::CreateTable(const CreateTableRequestPB* orig_req, leader_lock_.AssertAcquiredForReading(); RETURN_NOT_OK(CheckOnline()); - // If the HMS integration is enabled, wait for the notification log listener - // to catch up. This reduces the likelihood of attempting to create a table - // with a name that conflicts with a table that has just been deleted or - // renamed in the HMS. - RETURN_NOT_OK(WaitForNotificationLogListenerCatchUp(resp, rpc)); - // Copy the request, so we can fill in some defaults. CreateTableRequestPB req = *orig_req; LOG(INFO) << Substitute("Servicing CreateTable request from $0:\n$1", @@ -1435,6 +1429,12 @@ Status CatalogManager::CreateTable(const CreateTableRequestPB* orig_req, resp, MasterErrorPB::NOT_AUTHORIZED)); } + // If the HMS integration is enabled, wait for the notification log listener + // to catch up. This reduces the likelihood of attempting to create a table + // with a name that conflicts with a table that has just been deleted or + // renamed in the HMS. + RETURN_NOT_OK(WaitForNotificationLogListenerCatchUp(resp, rpc)); + Schema client_schema; RETURN_NOT_OK(SchemaFromPB(req.schema(), &client_schema));
