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
The following commit(s) were added to refs/heads/master by this push:
new c7bf1c1 KUDU-2817: Upgrade boost to 1.74.0
c7bf1c1 is described below
commit c7bf1c140e00ba8895ec6a14fa918c190dff2e1f
Author: Grant Henke <[email protected]>
AuthorDate: Tue Jul 28 10:20:15 2020 -0500
KUDU-2817: Upgrade boost to 1.74.0
We are currently on boost 1.61.0 which is from 2016. This patch
upgrades to 1.74.0, the latest version.
Change-Id: I68241d782adc7abd66b2cdef2b6408f434a4eff0
Reviewed-on: http://gerrit.cloudera.org:8080/16247
Tested-by: Alexey Serbin <[email protected]>
Reviewed-by: Bankim Bhavsar <[email protected]>
Reviewed-by: Grant Henke <[email protected]>
---
build-support/ubsan-blacklist.txt | 2 ++
src/kudu/experiments/rwlock-perf.cc | 13 ++-----
src/kudu/integration-tests/master_authz-itest.cc | 13 ++++---
src/kudu/integration-tests/master_hms-itest.cc | 8 ++---
.../integration-tests/table_locations-itest.cc | 2 +-
src/kudu/master/catalog_manager.cc | 40 +++++++++++++---------
src/kudu/master/master-test.cc | 6 ++--
src/kudu/master/master_service.cc | 21 ++++++------
src/kudu/rebalance/rebalance_algo.cc | 4 +--
src/kudu/tserver/tablet_service.cc | 4 +--
thirdparty/download-thirdparty.sh | 6 ++--
.../boost-issue-12179-fix-compilation-errors.patch | 11 ------
.../patches/boost-issue-440-darwin-version.patch | 19 ----------
thirdparty/vars.sh | 2 +-
14 files changed, 60 insertions(+), 91 deletions(-)
diff --git a/build-support/ubsan-blacklist.txt
b/build-support/ubsan-blacklist.txt
index eb544d0..4140431 100644
--- a/build-support/ubsan-blacklist.txt
+++ b/build-support/ubsan-blacklist.txt
@@ -36,6 +36,8 @@ fun:*mersenne_twister_engine*
src:*/boost/uuid/sha1.hpp
# include/boost/container/detail/copy_move_algo.hpp:949:11: runtime error:
unsigned integer overflow: 0 - 1 cannot be represented in type 'unsigned long'
src:*/boost/container/detail/copy_move_algo.hpp
+# include/boost/container_hash/hash.hpp:343:15: runtime error: unsigned
integer overflow: 2700868258 * 14313749767032793493 cannot be represented in
type 'unsigned long'
+src:*/boost/container_hash/hash.hpp
# include/boost/functional/hash/hash.hpp:212:52: runtime error: unsigned
integer overflow: 18389307270159922987 + 1512985112272252029 cannot be
represented in type 'unsigned long'
src:*/boost/functional/hash/hash.hpp
diff --git a/src/kudu/experiments/rwlock-perf.cc
b/src/kudu/experiments/rwlock-perf.cc
index 29ca01f..7df6742 100644
--- a/src/kudu/experiments/rwlock-perf.cc
+++ b/src/kudu/experiments/rwlock-perf.cc
@@ -26,11 +26,10 @@
#include <thread>
#include <vector>
-#include <boost/smart_ptr/shared_array.hpp>
+#include <boost/smart_ptr/detail/spinlock_std_atomic.hpp>
#include <gflags/gflags.h>
#include <glog/logging.h>
-#include "kudu/gutil/macros.h"
#include "kudu/gutil/port.h"
#include "kudu/gutil/sysinfo.h"
#include "kudu/gutil/walltime.h"
@@ -44,15 +43,7 @@ DEFINE_int32(num_threads, 8, "Number of threads to test");
using std::thread;
using std::vector;
-class my_spinlock : public boost::detail::spinlock {
- public:
- my_spinlock() {
- v_ = 0;
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(my_spinlock);
-};
+typedef boost::detail::spinlock my_spinlock;
struct PerCpuLock {
struct PaddedLock {
diff --git a/src/kudu/integration-tests/master_authz-itest.cc
b/src/kudu/integration-tests/master_authz-itest.cc
index 2b712ba..41b6252 100644
--- a/src/kudu/integration-tests/master_authz-itest.cc
+++ b/src/kudu/integration-tests/master_authz-itest.cc
@@ -310,12 +310,11 @@ class MasterAuthzITestHarness {
// Creates db.table and db.second_table.
virtual Status SetUpTables(const unique_ptr<ExternalMiniCluster>& cluster,
const shared_ptr<KuduClient>& client) {
+ static const string kUser = kAdminUser;
RETURN_NOT_OK(CreateKuduTable(kDatabaseName, kTableName, client));
RETURN_NOT_OK(CreateKuduTable(kDatabaseName, kSecondTable, client));
- CheckTable(kDatabaseName, kTableName,
- make_optional<const string&>(kAdminUser), cluster, client);
- CheckTable(kDatabaseName, kSecondTable,
- make_optional<const string&>(kAdminUser), cluster, client);
+ CheckTable(kDatabaseName, kTableName, kUser, cluster, client);
+ CheckTable(kDatabaseName, kSecondTable, kUser, cluster, client);
return Status::OK();
}
@@ -862,8 +861,8 @@ TEST_P(MasterAuthzITest, TestTrustedUserAcl) {
.set_range_partition_columns({"key"})
.set_owner("another_user")
.Create());
- NO_FATALS(this->CheckTable(kDatabaseName, "new_table",
- make_optional<const string&>(kImpalaUser)));
+ const string user = kImpalaUser;
+ NO_FATALS(this->CheckTable(kDatabaseName, "new_table", user));
}
TEST_P(MasterAuthzITest, TestAuthzListTables) {
@@ -1016,7 +1015,7 @@ TEST_P(MasterAuthzOwnerITest, TestMismatchedTable) {
ASSERT_OK(this->cluster_->CreateClient(nullptr, &client));
shared_ptr<KuduTable> table;
ASSERT_OK(client->OpenTable(table_name_a, &table));
- optional<const string&> table_id_a = make_optional<const
string&>(table->id());
+ optional<const string&> table_id_a = table->id();
// Log back as 'test-user'.
ASSERT_OK(this->cluster_->kdc()->Kinit(kTestUser));
diff --git a/src/kudu/integration-tests/master_hms-itest.cc
b/src/kudu/integration-tests/master_hms-itest.cc
index 8107b0c..e8ff507 100644
--- a/src/kudu/integration-tests/master_hms-itest.cc
+++ b/src/kudu/integration-tests/master_hms-itest.cc
@@ -309,18 +309,18 @@ TEST_F(MasterHmsTest, TestAlterTableOwner) {
NO_FATALS(CheckTable("default", "userTable", /*user=*/ none));
// Change the owner through the HMS, and ensure the owner is handled in Kudu.
- const char* const user_a = "user_a";
+ const string user_a = "user_a";
ASSERT_OK(ChangeHmsOwner("default", "userTable", user_a));
ASSERT_EVENTUALLY([&] {
- NO_FATALS(CheckTable("default", "userTable", make_optional<const
string&>(user_a)));
+ NO_FATALS(CheckTable("default", "userTable", user_a));
});
// Change the owner through Kudu, and ensure the owner is reflected in HMS.
- const char* const user_b = "user_b";
+ const string user_b = "user_b";
unique_ptr<KuduTableAlterer>
table_alterer(client_->NewTableAlterer("default.userTable"));
ASSERT_OK(table_alterer->SetOwner(user_b)->Alter());
ASSERT_EVENTUALLY([&] {
- NO_FATALS(CheckTable("default", "userTable", make_optional<const
string&>(user_b)));
+ NO_FATALS(CheckTable("default", "userTable", user_b));
});
}
diff --git a/src/kudu/integration-tests/table_locations-itest.cc
b/src/kudu/integration-tests/table_locations-itest.cc
index b58225f..ccb7106 100644
--- a/src/kudu/integration-tests/table_locations-itest.cc
+++ b/src/kudu/integration-tests/table_locations-itest.cc
@@ -537,7 +537,7 @@ TEST_F(TableLocationsTest,
GetTableLocationsBenchmarkFunctionCall) {
NO_FATALS(CreateTable(table_name, kNumSplits));
CatalogManager* cm = cluster_->mini_master()->master()->catalog_manager();
- const auto username = boost::make_optional<const string&>(kUserName);
+ const boost::optional<const string&> username = kUserName;
std::atomic<bool> stop(false);
vector<thread> threads;
diff --git a/src/kudu/master/catalog_manager.cc
b/src/kudu/master/catalog_manager.cc
index d834af2..3798ec6 100644
--- a/src/kudu/master/catalog_manager.cc
+++ b/src/kudu/master/catalog_manager.cc
@@ -60,6 +60,7 @@
#include <boost/optional/optional.hpp>
#include <boost/optional/optional_io.hpp> // IWYU pragma: keep
+#include <boost/type_traits/decay.hpp>
#include <gflags/gflags.h>
#include <glog/logging.h>
#include <google/protobuf/arena.h>
@@ -1605,8 +1606,10 @@ Status CatalogManager::CreateTable(const
CreateTableRequestPB* orig_req,
LOG(INFO) << Substitute("Servicing CreateTable request from $0:\n$1",
RequestorString(rpc), SecureDebugString(req));
- optional<const string&> user = rpc ?
- make_optional<const string&>(rpc->remote_user().username()) : none;
+ optional<const string&> user;
+ if (rpc) {
+ user = rpc->remote_user().username();
+ }
// Default the owner if it isn't set.
if (user && !req.has_owner()) {
req.set_owner(*user);
@@ -1837,8 +1840,8 @@ Status CatalogManager::CreateTable(const
CreateTableRequestPB* orig_req,
e->mutable_metadata()->AbortMutation();
}
});
- optional<string> dimension_label =
- req.has_dimension_label() ? make_optional<string>(req.dimension_label())
: none;
+ const optional<string> dimension_label =
+ req.has_dimension_label() ? make_optional(req.dimension_label()) : none;
for (const Partition& partition : partitions) {
PartitionPB partition_pb;
partition.ToPB(&partition_pb);
@@ -2136,8 +2139,10 @@ Status CatalogManager::DeleteTableRpc(const
DeleteTableRequestPB& req,
leader_lock_.AssertAcquiredForReading();
- optional<const string&> user = rpc ?
- make_optional<const string&>(rpc->remote_user().username()) : none;
+ optional<const string&> user;
+ if (rpc) {
+ user = rpc->remote_user().username();
+ }
// If the HMS integration is enabled and the table should be deleted in the
HMS,
// then don't directly remove the table from the Kudu catalog. Instead,
delete
@@ -2495,8 +2500,9 @@ Status CatalogManager::ApplyAlterPartitioningSteps(
PartitionPB partition_pb;
partition.ToPB(&partition_pb);
- optional<string> dimension_label =
step.add_range_partition().has_dimension_label() ?
-
make_optional<string>(step.add_range_partition().dimension_label()) : none;
+ const optional<string> dimension_label =
step.add_range_partition().has_dimension_label()
+ ? make_optional(step.add_range_partition().dimension_label())
+ : none;
new_tablets.emplace(lower_bound,
CreateTabletInfo(table, partition_pb,
dimension_label));
}
@@ -2571,8 +2577,10 @@ Status CatalogManager::AlterTableRpc(const
AlterTableRequestPB& req,
LOG(INFO) << Substitute("Servicing AlterTable request from $0:\n$1",
RequestorString(rpc), SecureShortDebugString(req));
- optional<const string&> user = rpc ?
- make_optional<const string&>(rpc->remote_user().username()) : none;
+ optional<const string&> user;
+ if (rpc) {
+ user = rpc->remote_user().username();
+ }
// If the HMS integration is enabled, the alteration includes a table
// rename and the table should be altered in the HMS, then don't directly
@@ -4811,8 +4819,9 @@ void CatalogManager::HandleAssignCreatingTablet(const
scoped_refptr<TabletInfo>&
const PersistentTabletInfo& old_info = tablet->metadata().state();
- optional<string> dimension_label = old_info.pb.has_dimension_label() ?
- make_optional<string>(old_info.pb.dimension_label()) : none;
+ const optional<string> dimension_label = old_info.pb.has_dimension_label()
+ ? make_optional(old_info.pb.dimension_label())
+ : none;
// The "tablet creation" was already sent, but we didn't receive an answer
// within the timeout. So the tablet will be replaced by a new one.
scoped_refptr<TabletInfo> replacement = CreateTabletInfo(tablet->table(),
@@ -5132,10 +5141,9 @@ Status CatalogManager::BuildLocationsForTablet(
};
const auto role = GetParticipantRole(peer, cstate);
- optional<string> dimension = none;
- if (l_tablet.data().pb.has_dimension_label()) {
- dimension = l_tablet.data().pb.dimension_label();
- }
+ const optional<string> dimension = l_tablet.data().pb.has_dimension_label()
+ ? make_optional(l_tablet.data().pb.dimension_label())
+ : none;
if (ts_infos_dict) {
const auto idx = ts_infos_dict->LookupOrAdd(peer.permanent_uuid(),
fill_tsinfo_pb);
auto* interned_replica_pb = locs_pb->add_interned_replicas();
diff --git a/src/kudu/master/master-test.cc b/src/kudu/master/master-test.cc
index 5b02797..064a41e 100644
--- a/src/kudu/master/master-test.cc
+++ b/src/kudu/master/master-test.cc
@@ -1214,8 +1214,10 @@ TEST_P(ConcurrentGetTableSchemaTest, DirectMethodCall) {
CatalogManager* cm = mini_master_->master()->catalog_manager();
const auto* token_signer = supports_authz_
? mini_master_->master()->token_signer() : nullptr;
- const auto username = supports_authz_
- ? boost::make_optional<const string&>(kUserName) : boost::none;
+ optional<const string&> username;
+ if (supports_authz_) {
+ username = kUserName;
+ }
// Start many threads that hammer the master with GetTableSchema() calls
// for various tables.
diff --git a/src/kudu/master/master_service.cc
b/src/kudu/master/master_service.cc
index 73c85ca..3eea33d 100644
--- a/src/kudu/master/master_service.cc
+++ b/src/kudu/master/master_service.cc
@@ -95,7 +95,6 @@ DEFINE_bool(master_support_authz_tokens, true,
"testing version compatibility in the client.");
TAG_FLAG(master_support_authz_tokens, hidden);
-using boost::make_optional;
using google::protobuf::Message;
using kudu::consensus::ReplicaManagementInfoPB;
using kudu::pb_util::SecureDebugString;
@@ -395,7 +394,7 @@ void MasterServiceImpl::GetTabletLocations(const
GetTabletLocationsRequestPB* re
tablet_id, req->replica_type_filter(),
locs_pb,
req->intern_ts_infos_in_response() ? &infos_dict : nullptr,
- make_optional<const string&>(rpc->remote_user().username()));
+ rpc->remote_user().username());
if (!s.ok()) {
resp->mutable_tablet_locations()->RemoveLast();
@@ -433,8 +432,8 @@ void MasterServiceImpl::IsCreateTableDone(const
IsCreateTableDoneRequestPB* req,
return;
}
- Status s = server_->catalog_manager()->IsCreateTableDone(
- req, resp, make_optional<const string&>(rpc->remote_user().username()));
+ auto s = server_->catalog_manager()->IsCreateTableDone(
+ req, resp, rpc->remote_user().username());
CheckRespErrorOrSetUnknown(s, resp);
rpc->RespondSuccess();
}
@@ -473,8 +472,8 @@ void MasterServiceImpl::IsAlterTableDone(const
IsAlterTableDoneRequestPB* req,
return;
}
- Status s = server_->catalog_manager()->IsAlterTableDone(
- req, resp, make_optional<const string&>(rpc->remote_user().username()));
+ auto s = server_->catalog_manager()->IsAlterTableDone(
+ req, resp, rpc->remote_user().username());
CheckRespErrorOrSetUnknown(s, resp);
rpc->RespondSuccess();
}
@@ -487,8 +486,8 @@ void MasterServiceImpl::ListTables(const
ListTablesRequestPB* req,
return;
}
- Status s = server_->catalog_manager()->ListTables(
- req, resp, make_optional<const string&>(rpc->remote_user().username()));
+ auto s = server_->catalog_manager()->ListTables(
+ req, resp, rpc->remote_user().username());
CheckRespErrorOrSetUnknown(s, resp);
rpc->RespondSuccess();
}
@@ -501,7 +500,7 @@ void MasterServiceImpl::GetTableStatistics(const
GetTableStatisticsRequestPB* re
return;
}
Status s = server_->catalog_manager()->GetTableStatistics(
- req, resp, make_optional<const string&>(rpc->remote_user().username()));
+ req, resp, rpc->remote_user().username());
CheckRespErrorOrSetUnknown(s, resp);
rpc->RespondSuccess();
}
@@ -523,7 +522,7 @@ void MasterServiceImpl::GetTableLocations(const
GetTableLocationsRequestPB* req,
SleepFor(MonoDelta::FromMilliseconds(FLAGS_master_inject_latency_on_tablet_lookups_ms));
}
s = server_->catalog_manager()->GetTableLocations(
- req, resp, make_optional<const
string&>(rpc->remote_user().username()));
+ req, resp, rpc->remote_user().username());
}
CheckRespErrorOrSetUnknown(s, resp);
@@ -541,7 +540,7 @@ void MasterServiceImpl::GetTableSchema(const
GetTableSchemaRequestPB* req,
}
s = server_->catalog_manager()->GetTableSchema(
- req, resp, make_optional<const string&>(rpc->remote_user().username()),
+ req, resp, rpc->remote_user().username(),
FLAGS_master_support_authz_tokens ? server_->token_signer() : nullptr);
}
diff --git a/src/kudu/rebalance/rebalance_algo.cc
b/src/kudu/rebalance/rebalance_algo.cc
index b2870cb..a1fda56 100644
--- a/src/kudu/rebalance/rebalance_algo.cc
+++ b/src/kudu/rebalance/rebalance_algo.cc
@@ -328,7 +328,7 @@ Status TwoDimensionalGreedyAlgo::GetNextMove(
// Move a replica of the selected table from a most loaded server to a
// least loaded server.
- *move = { tbi.table_id, max_loaded_uuid, min_loaded_uuid };
+ *move = TableReplicaMove{ tbi.table_id, max_loaded_uuid, min_loaded_uuid };
break;
}
@@ -612,7 +612,7 @@ Status LocationBalancingAlgo::FindBestMove(
const auto& src_ts_id = it_max->second;
CHECK_NE(src_ts_id, dst_ts_id);
- *move = { table_id, src_ts_id, dst_ts_id };
+ *move = TableReplicaMove{ table_id, src_ts_id, dst_ts_id };
return Status::OK();
}
diff --git a/src/kudu/tserver/tablet_service.cc
b/src/kudu/tserver/tablet_service.cc
index 87ce09d..a816ccf 100644
--- a/src/kudu/tserver/tablet_service.cc
+++ b/src/kudu/tserver/tablet_service.cc
@@ -30,6 +30,7 @@
#include <vector>
#include <boost/optional/optional.hpp>
+#include <boost/type_traits/decay.hpp>
#include <gflags/gflags.h>
#include <glog/logging.h>
@@ -92,7 +93,6 @@
#include "kudu/tserver/tserver.pb.h"
#include "kudu/tserver/tserver_admin.pb.h"
#include "kudu/tserver/tserver_service.pb.h"
-#include "kudu/util/bitset.h"
#include "kudu/util/crc.h"
#include "kudu/util/debug/trace_event.h"
#include "kudu/util/faststring.h"
@@ -1452,7 +1452,7 @@ void TabletServiceImpl::Write(const WriteRequestPB* req,
Status::NotAuthorized("not authorized to write"));
return;
}
- authz_context = { privileges, /*requested_op_types=*/{} };
+ authz_context = WriteAuthorizationContext{ privileges,
/*requested_op_types=*/{} };
}
shared_ptr<Tablet> tablet;
diff --git a/thirdparty/download-thirdparty.sh
b/thirdparty/download-thirdparty.sh
index bc1b930..3759f4b 100755
--- a/thirdparty/download-thirdparty.sh
+++ b/thirdparty/download-thirdparty.sh
@@ -346,13 +346,11 @@ fetch_and_patch \
$TRACE_VIEWER_SOURCE \
$TRACE_VIEWER_PATCHLEVEL
-BOOST_PATCHLEVEL=2
+BOOST_PATCHLEVEL=0
fetch_and_patch \
boost_${BOOST_VERSION}.tar.gz \
$BOOST_SOURCE \
- $BOOST_PATCHLEVEL \
- "patch -p0 < $TP_DIR/patches/boost-issue-12179-fix-compilation-errors.patch" \
- "patch -p0 < $TP_DIR/patches/boost-issue-440-darwin-version.patch"
+ $BOOST_PATCHLEVEL
# Return 0 if the current system appears to be el6 (either CentOS or proper
RHEL)
needs_openssl_workaround() {
diff --git a/thirdparty/patches/boost-issue-12179-fix-compilation-errors.patch
b/thirdparty/patches/boost-issue-12179-fix-compilation-errors.patch
deleted file mode 100644
index 6482abd..0000000
--- a/thirdparty/patches/boost-issue-12179-fix-compilation-errors.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- boost/optional/optional_fwd.hpp 2016-05-05 14:13:30.000000000 -0700
-+++ boost/optional/optional_fwd.hpp.new 2016-06-25 14:21:28.438835543
-0700
-@@ -16,7 +16,7 @@
- #ifndef BOOST_OPTIONAL_OPTIONAL_FWD_FLC_19NOV2002_HPP
- #define BOOST_OPTIONAL_OPTIONAL_FWD_FLC_19NOV2002_HPP
-
--#include <boost/config/suffix.hpp>
-+#include <boost/config.hpp>
-
- namespace boost {
-
diff --git a/thirdparty/patches/boost-issue-440-darwin-version.patch
b/thirdparty/patches/boost-issue-440-darwin-version.patch
deleted file mode 100644
index f2ab695..0000000
--- a/thirdparty/patches/boost-issue-440-darwin-version.patch
+++ /dev/null
@@ -1,19 +0,0 @@
---- tools/build/src/tools/darwin.jam
-+++ tools/build/src/tools/darwin.jam
-@@ -137,13 +137,14 @@ rule init ( version ? : command * : options * :
requirement * )
- # - Set the toolset generic common options.
- common.handle-options darwin : $(condition) : $(command) : $(options) ;
-
-+ real-version = [ regex.split $(real-version) \\. ] ;
- # - GCC 4.0 and higher in Darwin does not have -fcoalesce-templates.
-- if $(real-version) < "4.0.0"
-+ if [ version.version-less $(real-version) : 4 0 ]
- {
- flags darwin.compile.c++ OPTIONS $(condition) : -fcoalesce-templates ;
- }
- # - GCC 4.2 and higher in Darwin does not have -Wno-long-double.
-- if $(real-version) < "4.2.0"
-+ if [ version.version-less $(real-version) : 4 2 ]
- {
- flags darwin.compile OPTIONS $(condition) : -Wno-long-double ;
- }
diff --git a/thirdparty/vars.sh b/thirdparty/vars.sh
index 80a244b..95c2de8 100644
--- a/thirdparty/vars.sh
+++ b/thirdparty/vars.sh
@@ -166,7 +166,7 @@
TRACE_VIEWER_VERSION=21d76f8350fea2da2aa25cb6fd512703497d0c11
TRACE_VIEWER_NAME=kudu-trace-viewer-$TRACE_VIEWER_VERSION
TRACE_VIEWER_SOURCE=$TP_SOURCE_DIR/$TRACE_VIEWER_NAME
-BOOST_VERSION=1_61_0
+BOOST_VERSION=1_74_0
BOOST_NAME=boost_$BOOST_VERSION
BOOST_SOURCE=$TP_SOURCE_DIR/$BOOST_NAME