-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[multistage] Table level Access Validation, QPS Quota, Phase Metrics for multistage queries #10534
[multistage] Table level Access Validation, QPS Quota, Phase Metrics for multistage queries #10534
Conversation
Codecov Report
@@ Coverage Diff @@
## master #10534 +/- ##
=============================================
+ Coverage 27.80% 70.29% +42.49%
- Complexity 58 6465 +6407
=============================================
Files 2087 2103 +16
Lines 112307 112838 +531
Branches 16918 16992 +74
=============================================
+ Hits 31226 79323 +48097
+ Misses 77988 27953 -50035
- Partials 3093 5562 +2469
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1478 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
pinot-broker/src/main/java/org/apache/pinot/broker/broker/BasicAuthAccessControlFactory.java
Outdated
Show resolved
Hide resolved
pinot-broker/src/main/java/org/apache/pinot/broker/broker/ZkBasicAuthAccessControlFactory.java
Show resolved
Hide resolved
pinot-broker/src/main/java/org/apache/pinot/broker/broker/ZkBasicAuthAccessControlFactory.java
Outdated
Show resolved
Hide resolved
pinot-query-planner/src/main/java/org/apache/pinot/query/QueryEnvironment.java
Outdated
Show resolved
Hide resolved
...ker/src/main/java/org/apache/pinot/broker/requesthandler/MultiStageBrokerRequestHandler.java
Outdated
Show resolved
Hide resolved
0466096
to
4954749
Compare
fa2f724
to
90af525
Compare
pinot-broker/src/test/java/org/apache/pinot/broker/broker/BasicAuthAccessControlTest.java
Show resolved
Hide resolved
pinot-broker/src/main/java/org/apache/pinot/broker/api/AccessControl.java
Show resolved
Hide resolved
90af525
to
6080f46
Compare
...ker/src/main/java/org/apache/pinot/broker/requesthandler/MultiStageBrokerRequestHandler.java
Outdated
Show resolved
Hide resolved
...ker/src/main/java/org/apache/pinot/broker/requesthandler/MultiStageBrokerRequestHandler.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm mostly. thank you for adding the tests
pinot-broker/src/main/java/org/apache/pinot/broker/broker/ZkBasicAuthAccessControlFactory.java
Outdated
Show resolved
Hide resolved
...ker/src/main/java/org/apache/pinot/broker/requesthandler/MultiStageBrokerRequestHandler.java
Outdated
Show resolved
Hide resolved
...ker/src/main/java/org/apache/pinot/broker/requesthandler/MultiStageBrokerRequestHandler.java
Outdated
Show resolved
Hide resolved
@@ -155,11 +160,22 @@ private BrokerResponse handleRequest(long requestId, String query, | |||
compilationStartTimeNs = System.nanoTime(); | |||
switch (sqlNodeAndOptions.getSqlNode().getKind()) { | |||
case EXPLAIN: | |||
String plan = _queryEnvironment.explainQuery(query, sqlNodeAndOptions); | |||
queryPlanResult = _queryEnvironment.explainQuery(query, sqlNodeAndOptions); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For EXPLAIN
cases, shouldn't we consider deducting the qps quota for that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessarily for now because we don't send explain plan queries to server.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have the plan to support sending EXPLAIN queries to servers? If yes, probably we can add a TODO here in case if it's forgotten?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's no reason to send EXPLAIN PLAN to server since broker has all the information the servers have in order to create the PLAN. the only information on server is whether segment A has inverted index; and segment B doesn't have it (e.g. it was generated with a different table config). and
- sending per-segment level physical plan info back to user is neither necessary nor practical
- we can always view segment level info via other APIs
...ker/src/main/java/org/apache/pinot/broker/requesthandler/MultiStageBrokerRequestHandler.java
Show resolved
Hide resolved
...ker/src/main/java/org/apache/pinot/broker/requesthandler/MultiStageBrokerRequestHandler.java
Outdated
Show resolved
Hide resolved
...ker/src/main/java/org/apache/pinot/broker/requesthandler/MultiStageBrokerRequestHandler.java
Outdated
Show resolved
Hide resolved
fb91e84
to
042e8f7
Compare
Table Level Access Validation
For non-multistage queries, there are two levels of validations:
In MultistageBrokerRequestHandler, we currently only perform (1). This PR adds support for performing table level validations as well.
QPS Quota Checker
Added QPS Quota check for all tables involved in a multistage query
Phase Timers
We have the following phase timers currently:
Added phase timers for REQUEST_COMPILATION, AUTHORIZATION and QUERY_EXECUTION in this PR. T
cc: @siddharthteotia @somandal @walterddr