You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by gr...@apache.org on 2019/02/05 22:18:15 UTC
[kudu] 03/04: [master] add
--master_client_location_assignment_enabled flag
This is an automated email from the ASF dual-hosted git repository.
granthenke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git
commit 453e008e6a57f631d8660101630b4dda60129d65
Author: Alexey Serbin <al...@apache.org>
AuthorDate: Fri Feb 1 16:04:54 2019 -0800
[master] add --master_client_location_assignment_enabled flag
Added a test-only runtime flag --client_location_assignment_enabled
which is useful for test scenarios where it's necessary to assign
locations to tablet servers with assign-location.py but using
the --relaxed option is not an option.
Change-Id: Ie9631b5638b36d71e8a5a24144e857ffeeafeac5
Reviewed-on: http://gerrit.cloudera.org:8080/12337
Tested-by: Kudu Jenkins
Reviewed-by: Will Berkeley <wd...@gmail.com>
---
src/kudu/master/master_service.cc | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/src/kudu/master/master_service.cc b/src/kudu/master/master_service.cc
index b87e681..4a29a61 100644
--- a/src/kudu/master/master_service.cc
+++ b/src/kudu/master/master_service.cc
@@ -77,6 +77,15 @@ DEFINE_bool(master_non_leader_masters_propagate_tsk, false,
"tests scenarios only and should not be used elsewhere.");
TAG_FLAG(master_non_leader_masters_propagate_tsk, hidden);
+DEFINE_bool(master_client_location_assignment_enabled, true,
+ "Whether masters assign locations to connecting clients. "
+ "By default they do if the location assignment command is set, "
+ "but in some test scenarios it's useful to make masters assign "
+ "locations only to tablet servers, but not clients.");
+TAG_FLAG(master_client_location_assignment_enabled, hidden);
+TAG_FLAG(master_client_location_assignment_enabled, runtime);
+TAG_FLAG(master_client_location_assignment_enabled, unsafe);
+
using google::protobuf::Message;
using kudu::consensus::ReplicaManagementInfoPB;
using kudu::pb_util::SecureDebugString;
@@ -524,7 +533,8 @@ void MasterServiceImpl::ConnectToMaster(const ConnectToMasterRequestPB* /*req*/,
}
// Assign a location to the client if needed.
- if (!FLAGS_location_mapping_cmd.empty()) {
+ if (!FLAGS_location_mapping_cmd.empty() &&
+ PREDICT_TRUE(FLAGS_master_client_location_assignment_enabled)) {
string location;
Status s = GetLocationFromLocationMappingCmd(FLAGS_location_mapping_cmd,
rpc->remote_address().host(),