You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by aw...@apache.org on 2019/02/26 22:05:31 UTC
[kudu] 01/03: Add GetTableLocations tracing
This is an automated email from the ASF dual-hosted git repository.
awong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git
commit c557576195f6283718fa8baf1279ee1e2ad52b74
Author: Will Berkeley <wd...@gmail.org>
AuthorDate: Mon Feb 25 14:52:26 2019 -0800
Add GetTableLocations tracing
This adds minimal tracing to GetTableLocations. It's useful because
adding a trace event for the call makes it easier to count the calls in
bulk in a trace, and having the requestor string traced makes it
possible to attribute GetTableLocations calls to specific clients in
many cases, given that the trace will also include the hostport of the
client.
Change-Id: I92e0dd18de52596f2b9a419c1b6cf7a5666d24bc
Reviewed-on: http://gerrit.cloudera.org:8080/12585
Tested-by: Kudu Jenkins
Reviewed-by: Adar Dembo <ad...@cloudera.com>
---
src/kudu/master/catalog_manager.cc | 2 +-
src/kudu/master/master_service.cc | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/kudu/master/catalog_manager.cc b/src/kudu/master/catalog_manager.cc
index 3e36cab..63747f4 100644
--- a/src/kudu/master/catalog_manager.cc
+++ b/src/kudu/master/catalog_manager.cc
@@ -4592,7 +4592,7 @@ Status CatalogManager::ReplaceTablet(const string& tablet_id, ReplaceTabletRespo
Status CatalogManager::GetTableLocations(const GetTableLocationsRequestPB* req,
GetTableLocationsResponsePB* resp) {
- // If start-key is > end-key report an error instead of swap the two
+ // If start-key is > end-key report an error instead of swapping the two
// since probably there is something wrong app-side.
if (req->has_partition_key_start() && req->has_partition_key_end()
&& req->partition_key_start() > req->partition_key_end()) {
diff --git a/src/kudu/master/master_service.cc b/src/kudu/master/master_service.cc
index 375b7d0..7daefae 100644
--- a/src/kudu/master/master_service.cc
+++ b/src/kudu/master/master_service.cc
@@ -47,6 +47,7 @@
#include "kudu/security/token_signer.h"
#include "kudu/security/token_verifier.h"
#include "kudu/server/server_base.h"
+#include "kudu/util/debug/trace_event.h"
#include "kudu/util/flag_tags.h"
#include "kudu/util/logging.h"
#include "kudu/util/monotime.h"
@@ -399,6 +400,9 @@ void MasterServiceImpl::ListTables(const ListTablesRequestPB* req,
void MasterServiceImpl::GetTableLocations(const GetTableLocationsRequestPB* req,
GetTableLocationsResponsePB* resp,
rpc::RpcContext* rpc) {
+ TRACE_EVENT1("master", "GetTableLocations",
+ "requestor", rpc->requestor_string());
+
CatalogManager::ScopedLeaderSharedLock l(server_->catalog_manager());
if (!l.CheckIsInitializedAndIsLeaderOrRespond(resp, rpc)) {
return;