kudu git commit: KUDU-2191 (11/n): remove fallback logic from HmsCatalog

2018-05-14 Thread hahao
Repository: kudu
Updated Branches:
  refs/heads/master 5d113ec3c -> 61cd9510f


KUDU-2191 (11/n): remove fallback logic from HmsCatalog

HmsCatalog was originally written with fallback logic that would
liberally correct HMS entries when possible. In particular, altering a
non-existent table entry would result in the HMS Catalog creating a new
table entry. These liberal corrections allowed the HMS catalog to
'upgrade' legacy Kudu tables to have HMS entries automatically upon any
kind of alteration, but in certain race conditions[1] it could lead to a
single Kudu table having multiple HMS table entries with different
names. This will be problematic down the line for other integrations
like Sentry, which rely on HMS metadata being canonical.

This commit removes this logic, which simplifies HmsCatalog, and removes
the need for a bunch of the tests which covered this fallback logic. As
a result, the metadata upgrade tool is going to need a special path
which allows it to alter Kudu tables without modifying the HMS. That
will be included in a follow up commit.

[1]: consider the following operation sequence:

  - in Hive: ALTER TABLE a RENAME TO b
  - in Kudu: ALTER TABLE a RENAME TO c

  When handling the Kudu alter table, the 'a' table exists in the Kudu
  catalog, but not in the HMS. As a result the HmsCatalog creates a new
  table entry with name 'c'. At this point the HMS contains two table
  entries ('b' and 'c'), both representing the same Kudu table. This
  will cause problems for Sentry, for dropping the table, etc.

Change-Id: I0753b1868b406c32e183896caa0427eedebdd8f7
Reviewed-on: http://gerrit.cloudera.org:8080/10380
Reviewed-by: Adar Dembo 
Tested-by: Kudu Jenkins
Reviewed-by: Hao Hao 


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/61cd9510
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/61cd9510
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/61cd9510

Branch: refs/heads/master
Commit: 61cd9510ff07229280499ec0155fb6ca6b46d510
Parents: 5d113ec
Author: Dan Burkert 
Authored: Mon Apr 23 14:14:46 2018 -0700
Committer: Hao Hao 
Committed: Mon May 14 22:35:01 2018 +

--
 src/kudu/hms/hms_catalog-test.cc   |  77 +++--
 src/kudu/hms/hms_catalog.cc| 120 ++--
 src/kudu/hms/hms_catalog.h |  26 ++---
 src/kudu/integration-tests/master_hms-itest.cc |  51 -
 4 files changed, 58 insertions(+), 216 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/kudu/blob/61cd9510/src/kudu/hms/hms_catalog-test.cc
--
diff --git a/src/kudu/hms/hms_catalog-test.cc b/src/kudu/hms/hms_catalog-test.cc
index cbfe528..5a25d00 100644
--- a/src/kudu/hms/hms_catalog-test.cc
+++ b/src/kudu/hms/hms_catalog-test.cc
@@ -256,14 +256,8 @@ TEST_P(HmsCatalogTestParameterized, TestTableLifecycle) {
   ASSERT_OK(hms_catalog_->CreateTable(kTableId, kTableName, schema));
   NO_FATALS(CheckTable(kHmsDatabase, kHmsTableName, kTableId, schema));
 
-  // Create the table again. This should succeed since the table ID matches. 
The
-  // HMS catalog will automatically short-circuit creating the table.
-  // TODO(dan): once we have HMS catalog stats, assert that the op short 
circuits.
-  ASSERT_OK(hms_catalog_->CreateTable(kTableId, kTableName, schema));
-  NO_FATALS(CheckTable(kHmsDatabase, kHmsTableName, kTableId, schema));
-
-  // Create the table again, but with a different table ID.
-  Status s = hms_catalog_->CreateTable("new-table-id", kTableName, schema);
+  // Create the table again, and check that the expected failure occurs.
+  Status s = hms_catalog_->CreateTable(kTableId, kTableName, schema);
   ASSERT_TRUE(s.IsAlreadyPresent()) << s.ToString();
   NO_FATALS(CheckTable(kHmsDatabase, kHmsTableName, kTableId, schema));
 
@@ -281,35 +275,6 @@ TEST_P(HmsCatalogTestParameterized, TestTableLifecycle) {
   NO_FATALS(CheckTableDoesNotExist(kHmsDatabase, kHmsAlteredTableName));
 }
 
-// Checks that 'legacy' Kudu tables can be altered and dropped by the
-// HmsCatalog. Altering a legacy table to be HMS compliant should result in a
-// valid HMS table entry being created. Dropping a legacy table should do
-// nothing, but return success.
-TEST_F(HmsCatalogTest, TestLegacyTables) {
-  const string kTableId = "table-id";
-  const string kHmsDatabase = "default";
-
-  Schema schema = AllTypesSchema();
-  hive::Table table;
-
-  // Alter a table containing a non Hive-compatible character, and ensure an
-  // entry is created with the new (valid) name.
-  NO_FATALS(CheckTableDoesNotExist(kHmsDatabase, "a"));
-  ASSERT_OK(hms_catalog_->AlterTable(kTableId, "default.☃", "default.a", 

kudu git commit: Rename Hive MetaStore to Metastore

2018-05-14 Thread danburkert
Repository: kudu
Updated Branches:
  refs/heads/master ca3e38759 -> 5d113ec3c


Rename Hive MetaStore to Metastore

Hive isn't consistent about the capitilization so it's not clear which
is more correct, but we should at least be consistent ourselves.

Change-Id: I47c0a6534de9d612787c23e2886b4150e3b69527
Reviewed-on: http://gerrit.cloudera.org:8080/10379
Tested-by: Kudu Jenkins
Reviewed-by: Dan Burkert 


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/5d113ec3
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/5d113ec3
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/5d113ec3

Branch: refs/heads/master
Commit: 5d113ec3c3a7296cc7a704bad415c74aab9f49fa
Parents: ca3e387
Author: Dan Burkert 
Authored: Fri May 11 10:41:13 2018 -0700
Committer: Dan Burkert 
Committed: Mon May 14 19:44:24 2018 +

--
 src/kudu/hms/hms_client.cc | 30 +++---
 src/kudu/hms/hms_client.h  |  2 +-
 src/kudu/hms/mini_hms.cc   |  6 +++---
 3 files changed, 19 insertions(+), 19 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/kudu/blob/5d113ec3/src/kudu/hms/hms_client.cc
--
diff --git a/src/kudu/hms/hms_client.cc b/src/kudu/hms/hms_client.cc
index ca6fdb8..3f1f948 100644
--- a/src/kudu/hms/hms_client.cc
+++ b/src/kudu/hms/hms_client.cc
@@ -53,7 +53,7 @@
 // Default to 100 MiB to match Thrift TSaslTransport.receiveSaslMessage and the
 // HMS metastore.server.max.message.size config.
 DEFINE_int32(hms_client_max_buf_size, 100 * 1024 * 1024,
- "Maximum size of Hive MetaStore objects that can be received by 
the "
+ "Maximum size of Hive Metastore objects that can be received by 
the "
  "HMS client in bytes.");
 TAG_FLAG(hms_client_max_buf_size, experimental);
 // Note: despite being marked as a runtime flag, the new buf size value will
@@ -176,13 +176,13 @@ HmsClient::~HmsClient() {
 Status HmsClient::Start() {
   SCOPED_LOG_SLOW_EXECUTION(WARNING, kSlowExecutionWarningThresholdMs, 
"starting HMS client");
   HMS_RET_NOT_OK(client_.getOutputProtocol()->getTransport()->open(),
- "failed to open Hive MetaStore connection");
+ "failed to open Hive Metastore connection");
 
   // Immediately after connecting to the HMS, check that it is configured with
   // the required event listeners.
   string event_listener_config;
   HMS_RET_NOT_OK(client_.get_config_value(event_listener_config, 
kTransactionalEventListeners, ""),
- Substitute("failed to get Hive MetaStore $0 configuration",
+ Substitute("failed to get Hive Metastore $0 configuration",
 kTransactionalEventListeners));
 
   // Parse the set of listeners from the configuration string.
@@ -214,7 +214,7 @@ Status HmsClient::Start() {
   
HMS_RET_NOT_OK(client_.get_config_value(disallow_incompatible_column_type_changes,
   kDisallowIncompatibleColTypeChanges,
   "false"),
- Substitute("failed to get Hive MetaStore $0 configuration",
+ Substitute("failed to get Hive Metastore $0 configuration",
 kDisallowIncompatibleColTypeChanges));
 
   if (boost::iequals(disallow_incompatible_column_type_changes, "true")) {
@@ -229,7 +229,7 @@ Status HmsClient::Start() {
 Status HmsClient::Stop() {
   SCOPED_LOG_SLOW_EXECUTION(WARNING, kSlowExecutionWarningThresholdMs, 
"stopping HMS client");
   HMS_RET_NOT_OK(client_.getInputProtocol()->getTransport()->close(),
- "failed to close Hive MetaStore connection");
+ "failed to close Hive Metastore connection");
   return Status::OK();
 }
 
@@ -239,14 +239,14 @@ bool HmsClient::IsConnected() {
 
 Status HmsClient::CreateDatabase(const hive::Database& database) {
   SCOPED_LOG_SLOW_EXECUTION(WARNING, kSlowExecutionWarningThresholdMs, "create 
HMS database");
-  HMS_RET_NOT_OK(client_.create_database(database), "failed to create Hive 
MetaStore database");
+  HMS_RET_NOT_OK(client_.create_database(database), "failed to create Hive 
Metastore database");
   return Status::OK();
 }
 
 Status HmsClient::DropDatabase(const string& database_name, Cascade cascade) {
   SCOPED_LOG_SLOW_EXECUTION(WARNING, kSlowExecutionWarningThresholdMs, "drop 
HMS database");
   HMS_RET_NOT_OK(client_.drop_database(database_name, true, cascade == 
Cascade::kTrue),
- "failed to drop Hive MetaStore database");
+ "failed to drop Hive Metastore database");
   return Status::OK();
 }
 
@@ -254,7 +254,7 @@ Status HmsClient::GetAllDatabases(vector* 
databases) {
   DCHECK(databases);
   

kudu git commit: catalog-manager: refactor AlterTable and DeleteTable methods

2018-05-14 Thread danburkert
Repository: kudu
Updated Branches:
  refs/heads/master a65e58ec0 -> ca3e38759


catalog-manager: refactor AlterTable and DeleteTable methods

This commit splits CatalogManager::AlterTable and
CatalogManager::DeleteTable in two. One method handles RPC specifics,
and the second handles applying the alter/delete operation to the Kudu
catalog. The RPC-handling method thus calls into the method which
modifies the catalog.  A follow-up commit in the HMS integration series
will add another front-end method specific to HMS notification log
listener events.

Change-Id: Ia384768ee7246411052ccadc66c33e83b541c195
Reviewed-on: http://gerrit.cloudera.org:8080/10378
Tested-by: Kudu Jenkins
Reviewed-by: Dan Burkert 


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/ca3e3875
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/ca3e3875
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/ca3e3875

Branch: refs/heads/master
Commit: ca3e387591d1947c24f9af814bb6429447902db5
Parents: a65e58e
Author: Dan Burkert 
Authored: Thu May 10 13:01:33 2018 -0700
Committer: Dan Burkert 
Committed: Mon May 14 19:20:05 2018 +

--
 src/kudu/integration-tests/alter_table-test.cc |  2 +-
 src/kudu/master/catalog_manager.cc | 75 -
 src/kudu/master/catalog_manager.h  | 25 ---
 src/kudu/master/master_service.cc  |  4 +-
 4 files changed, 62 insertions(+), 44 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/kudu/blob/ca3e3875/src/kudu/integration-tests/alter_table-test.cc
--
diff --git a/src/kudu/integration-tests/alter_table-test.cc 
b/src/kudu/integration-tests/alter_table-test.cc
index f771209..640f1cb 100644
--- a/src/kudu/integration-tests/alter_table-test.cc
+++ b/src/kudu/integration-tests/alter_table-test.cc
@@ -344,7 +344,7 @@ TEST_F(AlterTableTest, 
TestAddNotNullableColumnWithoutDefaults) {
 cluster_->mini_master()->master()->catalog_manager();
 master::CatalogManager::ScopedLeaderSharedLock l(catalog);
 ASSERT_OK(l.first_failed_status());
-Status s = catalog->AlterTable(, , nullptr);
+Status s = catalog->AlterTableRpc(req, , nullptr);
 ASSERT_TRUE(s.IsInvalidArgument());
 ASSERT_STR_CONTAINS(s.ToString(), "column `c2`: NOT NULL columns must have 
a default");
   }

http://git-wip-us.apache.org/repos/asf/kudu/blob/ca3e3875/src/kudu/master/catalog_manager.cc
--
diff --git a/src/kudu/master/catalog_manager.cc 
b/src/kudu/master/catalog_manager.cc
index 174c7fc..6438901 100644
--- a/src/kudu/master/catalog_manager.cc
+++ b/src/kudu/master/catalog_manager.cc
@@ -1700,19 +1700,22 @@ Status CatalogManager::FindAndLockTable(const ReqClass& 
request,
   return Status::OK();
 }
 
-Status CatalogManager::DeleteTable(const DeleteTableRequestPB* req,
-   DeleteTableResponsePB* resp,
-   rpc::RpcContext* rpc) {
+Status CatalogManager::DeleteTableRpc(const DeleteTableRequestPB& req,
+  DeleteTableResponsePB* resp,
+  rpc::RpcContext* rpc) {
+  LOG(INFO) << Substitute("Servicing DeleteTable request from $0:\n$1",
+  RequestorString(rpc), SecureShortDebugString(req));
+  return DeleteTable(req, resp);
+}
+
+Status CatalogManager::DeleteTable(const DeleteTableRequestPB& req, 
DeleteTableResponsePB* resp) {
   leader_lock_.AssertAcquiredForReading();
   RETURN_NOT_OK(CheckOnline());
 
-  LOG(INFO) << Substitute("Servicing DeleteTable request from $0:\n$1",
-  RequestorString(rpc), SecureShortDebugString(*req));
-
   // 1. Look up the table, lock it, and mark it as removed.
   scoped_refptr table;
   TableMetadataLock l;
-  RETURN_NOT_OK(FindAndLockTable(*req, resp, LockMode::WRITE, , ));
+  RETURN_NOT_OK(FindAndLockTable(req, resp, LockMode::WRITE, , ));
   if (l.data().is_deleted()) {
 return SetupError(Status::NotFound("the table was deleted", 
l.data().pb.state_msg()),
 resp, MasterErrorPB::TABLE_NOT_FOUND);
@@ -1788,7 +1791,9 @@ Status CatalogManager::DeleteTable(const 
DeleteTableRequestPB* req,
   TRACE("Removing table from by-name map");
   std::lock_guard l_map(lock_);
   if (table_names_map_.erase(l.data().name()) != 1) {
-PANIC_RPC(rpc, "Could not remove table from map, name=" + 
l.data().name());
+LOG(FATAL) << "Could not remove table " << table->ToString()
+   << " from map in response to DeleteTable request: "
+   << SecureShortDebugString(req);
   }
 }
 
@@ -2064,19 

kudu git commit: catalog-manager: return error from FindAndLockTable if table not found

2018-05-14 Thread danburkert
Repository: kudu
Updated Branches:
  refs/heads/master 1a707b991 -> a65e58ec0


catalog-manager: return error from FindAndLockTable if table not found

This cleans up some repeated boilerplate in the CatalogManager.

Change-Id: I4d8176d6886474a84b4c75c80f50763eabe70a6d
Reviewed-on: http://gerrit.cloudera.org:8080/10377
Reviewed-by: Adar Dembo 
Tested-by: Kudu Jenkins


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/a65e58ec
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/a65e58ec
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/a65e58ec

Branch: refs/heads/master
Commit: a65e58ec0612e6c20757fa51fe4e37056d5a4815
Parents: 1a707b9
Author: Dan Burkert 
Authored: Thu May 10 12:40:27 2018 -0700
Committer: Dan Burkert 
Committed: Mon May 14 19:17:04 2018 +

--
 src/kudu/master/catalog_manager.cc | 83 -
 src/kudu/master/catalog_manager.h  |  7 ++-
 2 files changed, 36 insertions(+), 54 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/kudu/blob/a65e58ec/src/kudu/master/catalog_manager.cc
--
diff --git a/src/kudu/master/catalog_manager.cc 
b/src/kudu/master/catalog_manager.cc
index 1de0be1..174c7fc 100644
--- a/src/kudu/master/catalog_manager.cc
+++ b/src/kudu/master/catalog_manager.cc
@@ -620,12 +620,15 @@ void CheckIfNoLongerLeaderAndSetupError(const Status& s, 
RespClass* resp) {
 template
 Status CheckIfTableDeletedOrNotRunning(TableMetadataLock* lock, RespClass* 
resp) {
   if (lock->data().is_deleted()) {
-return SetupError(Status::NotFound("the table was deleted", 
lock->data().pb.state_msg()),
-  resp, MasterErrorPB::TABLE_NOT_FOUND);
+return SetupError(Status::NotFound(
+  Substitute("table $0 was deleted", lock->data().name()),
+  lock->data().pb.state_msg()),
+resp, MasterErrorPB::TABLE_NOT_FOUND);
   }
   if (!lock->data().is_running()) {
-return SetupError(Status::ServiceUnavailable("the table is not running"),
-  resp, MasterErrorPB::TABLE_NOT_FOUND);
+return SetupError(Status::ServiceUnavailable(
+  Substitute("table $0 is not running", lock->data().name())),
+resp, MasterErrorPB::TABLE_NOT_FOUND);
   }
   return Status::OK();
 }
@@ -1601,15 +1604,9 @@ Status CatalogManager::IsCreateTableDone(const 
IsCreateTableDoneRequestPB* req,
   RETURN_NOT_OK(CheckOnline());
 
   // 1. Lookup the table and verify if it exists
-  TRACE("Looking up and locking table");
   scoped_refptr table;
   TableMetadataLock l;
-  RETURN_NOT_OK(FindAndLockTable(req->table(), LockMode::READ, , ));
-  if (table == nullptr) {
-return SetupError(
-Status::NotFound("the table does not exist", 
SecureShortDebugString(req->table())),
-resp, MasterErrorPB::TABLE_NOT_FOUND);
-  }
+  RETURN_NOT_OK(FindAndLockTable(*req, resp, LockMode::READ, , ));
   RETURN_NOT_OK(CheckIfTableDeletedOrNotRunning(, resp));
 
   // 2. Verify if the create is in-progress
@@ -1649,10 +1646,21 @@ scoped_refptr 
CatalogManager::CreateTabletInfo(const scoped_refptr
+Status CatalogManager::FindAndLockTable(const ReqClass& request,
+RespClass* response,
 LockMode lock_mode,
 scoped_refptr* table_info,
 TableMetadataLock* table_lock) {
+  TRACE("Looking up and locking table");
+  const TableIdentifierPB& table_identifier = request.table();
+
+  auto tnf_error = [&] {
+return SetupError(Status::NotFound(
+  "the table does not exist", 
SecureShortDebugString(table_identifier)),
+response, MasterErrorPB::TABLE_NOT_FOUND);
+  };
+
   scoped_refptr table;
   {
 shared_lock l(lock_);
@@ -1663,18 +1671,19 @@ Status CatalogManager::FindAndLockTable(const 
TableIdentifierPB& table_identifie
   // both match the same table.
   if (table_identifier.has_table_name() &&
   table.get() != FindPtrOrNull(table_names_map_, 
table_identifier.table_name()).get()) {
-return Status::OK();
+return tnf_error();
   }
 } else if (table_identifier.has_table_name()) {
   table = FindPtrOrNull(table_names_map_, table_identifier.table_name());
 } else {
-  return Status::InvalidArgument("Missing Table ID or Table Name");
+  return SetupError(Status::InvalidArgument("missing table ID or table 
name"),
+response, MasterErrorPB::UNKNOWN_ERROR);
 }
   }
 
   // If the table doesn't exist, don't attempt to lock it.
   if (!table) {
-return Status::OK();
+return tnf_error();
   }
 
   // Acquire the table lock.
@@ -1683,7 

kudu git commit: catalog-manager: refactor error handling

2018-05-14 Thread danburkert
Repository: kudu
Updated Branches:
  refs/heads/master 05d594867 -> 1a707b991


catalog-manager: refactor error handling

This commit refactors how the SetupError helper works slightly in order
to reduce the prevelance of temporary Status locals. I've found the
Status locals to be error prone in the past due to shadowing.

Change-Id: I695a62a75a3b1979741e2d7105ed131eace64b6d
Reviewed-on: http://gerrit.cloudera.org:8080/10376
Reviewed-by: Adar Dembo 
Tested-by: Kudu Jenkins


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/1a707b99
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/1a707b99
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/1a707b99

Branch: refs/heads/master
Commit: 1a707b991785a5a7d4d316d721d813f49d0bb7e5
Parents: 05d5948
Author: Dan Burkert 
Authored: Thu May 10 11:11:10 2018 -0700
Committer: Dan Burkert 
Committed: Mon May 14 18:35:12 2018 +

--
 src/kudu/client/client-test.cc |  14 +-
 src/kudu/master/catalog_manager.cc | 244 ++--
 2 files changed, 117 insertions(+), 141 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/kudu/blob/1a707b99/src/kudu/client/client-test.cc
--
diff --git a/src/kudu/client/client-test.cc b/src/kudu/client/client-test.cc
index 28f12e2..6fad6e8 100644
--- a/src/kudu/client/client-test.cc
+++ b/src/kudu/client/client-test.cc
@@ -768,7 +768,7 @@ TEST_F(ClientTest, TestBadTable) {
   shared_ptr t;
   Status s = client_->OpenTable("xxx-does-not-exist", );
   ASSERT_TRUE(s.IsNotFound());
-  ASSERT_STR_CONTAINS(s.ToString(), "Not found: The table does not exist");
+  ASSERT_STR_CONTAINS(s.ToString(), "Not found: the table does not exist");
 }
 
 // Test that, if the master is down, we experience a network error talking
@@ -3926,7 +3926,7 @@ TEST_F(ClientTest, TestDeleteTable) {
   // Try to open the deleted table
   Status s = client_->OpenTable(kTableName, _table_);
   ASSERT_TRUE(s.IsNotFound());
-  ASSERT_STR_CONTAINS(s.ToString(), "The table does not exist");
+  ASSERT_STR_CONTAINS(s.ToString(), "the table does not exist");
 
   // Create a new table with the same name. This is to ensure that the client
   // doesn't cache anything inappropriately by table name (see KUDU-1055).
@@ -3946,7 +3946,7 @@ TEST_F(ClientTest, TestGetTableSchema) {
   // Verify that a get schema request for a missing table throws not found
   Status s = client_->GetTableSchema("MissingTableName", );
   ASSERT_TRUE(s.IsNotFound());
-  ASSERT_STR_CONTAINS(s.ToString(), "The table does not exist");
+  ASSERT_STR_CONTAINS(s.ToString(), "the table does not exist");
 }
 
 // Test creating and accessing a table which has multiple tablets,
@@ -4439,15 +4439,15 @@ TEST_F(ClientTest, TestCreateTableWithTooManyTablets) {
   .Create();
   ASSERT_TRUE(s.IsInvalidArgument());
   ASSERT_STR_CONTAINS(s.ToString(),
-  "The requested number of tablets is over the "
+  "the requested number of tablets is over the "
   "maximum permitted at creation time (1)");
 }
 
 // Tests for too many replicas, too few replicas, even replica count, etc.
 TEST_F(ClientTest, TestCreateTableWithBadNumReplicas) {
   const vector> cases = {
-{3, "Not enough live tablet servers to create a table with the requested "
- "replication factor 3. 1 tablet servers are alive"},
+{3, "not enough live tablet servers to create a table with the requested "
+ "replication factor 3; 1 tablet servers are alive"},
 {2, "illegal replication factor 2 (replication factor must be odd)"},
 {-1, "illegal replication factor -1 (replication factor must be 
positive)"},
 {11, "illegal replication factor 11 (max replication factor is 7)"}
@@ -4510,7 +4510,7 @@ TEST_F(ClientTest, TestCreateTable_TableNames) {
 // From 
http://stackoverflow.com/questions/1301402/example-invalid-utf8-string
 {string("foo\xf0\x28\x8c\xbc", 7), "invalid table name: invalid UTF8 
sequence"},
 // Should pass validation but fail due to lack of tablet servers running.
-{"你好", "Not enough live tablet servers"}
+{"你好", "not enough live tablet servers"}
   };
 
   for (const auto& test_case : kCases) {

http://git-wip-us.apache.org/repos/asf/kudu/blob/1a707b99/src/kudu/master/catalog_manager.cc
--
diff --git a/src/kudu/master/catalog_manager.cc 
b/src/kudu/master/catalog_manager.cc
index bf87e4f..1de0be1 100644
--- a/src/kudu/master/catalog_manager.cc
+++ b/src/kudu/master/catalog_manager.cc
@@ -588,6 +588,16 @@ string RequestorString(RpcContext* rpc) {
   }
 }
 
+// If 's' is not OK, fills in 

kudu git commit: KUDU-2346: Fix mac pkg-config issue.

2018-05-14 Thread danburkert
Repository: kudu
Updated Branches:
  refs/heads/branch-1.7.x 5c68767d3 -> 5ef577b65


KUDU-2346: Fix mac pkg-config issue.

Previously an empty return string from pkg-config --cflags was used
as a proxy for testing if the package was installed. The MacOs version
of pkg-config returns an error message in response to this command
when a package is not installed.

The fix is to property test the return value of pkg-config --cflags.

Change-Id: I8a6b543dc65ac65d0dedf7e39f735b4805612bf1
Reviewed-on: http://gerrit.cloudera.org:8080/9652
Reviewed-by: Alexey Serbin 
Tested-by: Alexey Serbin 
(cherry picked from commit 9f6b7f16828250a89e0e331026eeb05687c6eeab)
Reviewed-on: http://gerrit.cloudera.org:8080/10373
Tested-by: Kudu Jenkins


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/5ef577b6
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/5ef577b6
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/5ef577b6

Branch: refs/heads/branch-1.7.x
Commit: 5ef577b657f0e06b38cc2ce6e31f1b0b46eeab4d
Parents: 5c68767
Author: Attila Bukor 
Authored: Sat May 12 10:59:56 2018 +0200
Committer: Alexey Serbin 
Committed: Mon May 14 18:02:09 2018 +

--
 thirdparty/build-thirdparty.sh | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/kudu/blob/5ef577b6/thirdparty/build-thirdparty.sh
--
diff --git a/thirdparty/build-thirdparty.sh b/thirdparty/build-thirdparty.sh
index f91bc1f..beb8f97 100755
--- a/thirdparty/build-thirdparty.sh
+++ b/thirdparty/build-thirdparty.sh
@@ -171,8 +171,7 @@ elif [[ "$OSTYPE" == "darwin"* ]]; then
 
   # Build against the Macports or Homebrew OpenSSL versions, in order to match
   # the Kudu build.
-  OPENSSL_CFLAGS=$(pkg-config --cflags openssl)
-  if [ -z $OPENSSL_CFLAGS ]; then
+  if ! OPENSSL_CFLAGS=$(pkg-config --cflags openssl); then
 # If OpenSSL is built via Homebrew, pkg-config does not report on cflags.
 homebrew_openssl_dir=/usr/local/opt/openssl
 if [ -d $homebrew_openssl_dir ]; then