Hao Hao has submitted this change and it was merged. ( 
http://gerrit.cloudera.org:8080/13493 )

Change subject: sentry: add trace points
......................................................................

sentry: add trace points

Adds TRACE statements at various points in Sentry authorization that I
found useful in debugging authorization performance.

With the trace points, we can now identify:
- whether an RPC is waiting for an in-flight call to Sentry for its
  privileges, or sending a new request to Sentry
- the time taken to receive privileges from Sentry
- the time taken to evaluate in-memory privileges

Here's an example of a CreateTable trace pulled from /rpcz (cleaned up
a bit for the spacing):

"trace": "0529 19:22:26.794605
(+     0) service_pool.cc:162] Inserting onto call queue
(+    46) service_pool.cc:221] Handling call
(+   150) sentry_privileges_fetcher.cc:694] Fetching privileges from Sentry
(+ 29438) sentry_authz_provider.cc:77] Evaluating privileges
(+  4071) catalog_manager.cc:1587] Acquired catalog manager lock 19:22:26.828355
(+    45) catalog_manager.cc:1631] Created new table and tablet info
(+1107724) catalog_manager.cc:1657] Created new table in HMS catalog
(+   773) catalog_manager.cc:1680] Wrote table and tablets to system table
(+    74) catalog_manager.cc:1714] Inserted table and tablets into 
CatalogManager maps
(+    36) inbound_call.cc:162] Queueing success response\nRelated trace 'txn':
(+     0) write_transaction.cc:152] PREPARE: Starting.
(+    27) write_transaction.cc:332] Acquiring schema lock in shared mode
(+     1) write_transaction.cc:335] Acquired schema lock
(+     0) tablet.cc:437] Decoding operations
(+    20) tablet.cc:459] Acquiring locks for 9 operations
(+    29) tablet.cc:463] Locks acquired
(+     0) write_transaction.cc:187] PREPARE: Finished.
(+     4) write_transaction.cc:197] Start()
(+     2) write_transaction.cc:202] Timestamp: L: 43236
(+     0) transaction_driver.cc:325] REPLICATION: Starting.
(+    31) log.cc:588] Serialized 1331 byte log entry
(+   187) transaction_driver.cc:438] REPLICATION: Finished.
(+    55) write_transaction.cc:210] APPLY: Starting.
(+   147) tablet_metrics.cc:371] ProbeStats: 
bloom_lookups=9,key_file_lookups=0,delta_file_lookups=0,mrs_lookups=0
(+     2) write_transaction.cc:221] APPLY: Finished.
(+    41) log.cc:588] Serialized 72 byte log entry
(+    10) write_transaction.cc:376] Releasing row and schema locks
(+     5) write_transaction.cc:341] Released schema lock
(+     3) write_transaction.cc:258] FINISH: Updating metrics.
(+     7) write_transaction.cc:376] Releasing row and schema locks
(+     0) write_transaction.cc:341] Released schema lock

Change-Id: I8ed344aa38437faf4d6cfa9640cad443f38f6bd8
Reviewed-on: http://gerrit.cloudera.org:8080/13493
Reviewed-by: Hao Hao <hao....@cloudera.com>
Reviewed-by: Alexey Serbin <aser...@cloudera.com>
Tested-by: Andrew Wong <aw...@cloudera.com>
---
M src/kudu/master/sentry_authz_provider.cc
M src/kudu/master/sentry_privileges_fetcher.cc
2 files changed, 5 insertions(+), 0 deletions(-)

Approvals:
  Hao Hao: Looks good to me, approved
  Alexey Serbin: Looks good to me, approved
  Andrew Wong: Verified

--
To view, visit http://gerrit.cloudera.org:8080/13493
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I8ed344aa38437faf4d6cfa9640cad443f38f6bd8
Gerrit-Change-Number: 13493
Gerrit-PatchSet: 4
Gerrit-Owner: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <aser...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Hao Hao <hao....@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)

Reply via email to